1
0
mirror of https://github.com/geerlingguy/ansible-for-devops.git synced 2024-05-19 06:50:03 +00:00
Files

45 lines
2.7 KiB
Markdown
Raw Permalink Normal View History

2014-04-24 20:44:35 -05:00
# Simple Node.js Development VM
This project aims to make spinning up a simple local Node.js test/development environment incredibly quick and easy, and to introduce new developers to the wonderful world of Node.js development on local virtual machines.
2015-09-25 22:18:45 -05:00
It will install the following on a CentOS 7 Linux VM:
2014-04-24 20:44:35 -05:00
- Node.js (latest version in EPEL repository)
- Express
- A simple demonstration Node.js app
It should take 5-10 minutes to build or rebuild the VM from scratch on a decent broadband connection.
## Quick Start Guide
### 1 - Install dependencies (VirtualBox, Vagrant, Ansible)
1. Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads).
2. Download and install [Vagrant](http://www.vagrantup.com/downloads.html).
3. [Mac/Linux only] Install [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html).
2014-04-24 20:44:35 -05:00
2015-09-25 22:18:45 -05:00
Note for Windows users: *This guide assumes you're on a Mac or Linux host. Windows hosts are unsupported at this time.*
2014-04-24 20:44:35 -05:00
### 2 - Build the Virtual Machine
1. Download this project and put it wherever you want.
2016-02-28 21:40:28 -06:00
2. Open Terminal, cd to this directory (containing the `Vagrantfile` and this README file).
2014-04-24 20:44:35 -05:00
3. Type in `vagrant up`, and let Vagrant do its magic.
Note: *If there are any errors during the course of running `vagrant up`, and it drops you back to your command prompt, just run `vagrant provision` to continue building the VM from where you left off. If there are still errors after doing this a few times, post an issue to this project's issue queue on GitHub with the error.*
### 3 - Configure your host machine to access the VM.
1. [Edit your hosts file](http://docs.rackspace.com/support/how-to/modify-your-hosts-file/), adding the line `192.168.56.55 nodejs.test` so you can connect to the VM.
2. Open your browser and access [http://nodejs.test/](http://nodejs.test/).
2014-04-24 20:44:35 -05:00
## Notes
- To shut down the virtual machine, enter `vagrant halt` in the Terminal in the same folder that has the `Vagrantfile`. To destroy it completely (if you want to save a little disk space, or want to rebuild it from scratch with `vagrant up` again), type in `vagrant destroy`.
- Find out more about local development with Vagrant + VirtualBox + Ansible in this presentation: [Local Development Environments - Vagrant, VirtualBox and Ansible](http://www.slideshare.net/geerlingguy/local-development-on-virtual-machines-vagrant-virtualbox-and-ansible).
2016-07-15 14:11:57 -05:00
- Learn about how Ansible can accelerate your ability to innovate and manage your infrastructure by reading [Ansible for DevOps](https://www.ansiblefordevops.com/).
2014-04-24 20:44:35 -05:00
## About the Author
2017-05-26 15:31:28 -04:00
This project was created by [Jeff Geerling](https://www.jeffgeerling.com/) as an example for [Ansible for DevOps](https://www.ansiblefordevops.com/).