This configuration will install the latest versions of MongoDB, Nginx, Node.js, Express, Yeoman, and the Yeoman Angular.js generator. Ruby and the compass gem are installed for the yo build process.
All running on the Ubuntu 13.10 (Saucy Salamander)
- Install Vagrant 1.3.5
- Install VirtualBox 4.3
- Install Ansible
Running and provisioning can be handled nicely:
vagrant up
You can SSH into the provisioned vm like so:
vagrant ssh
And stop it:
vagrant halt
Voila! You have a development enviroment with the latest and greatest Node.js, MongoDB, and Yeoman.
Note: part of the provisioning process ensures that Mongo is already running on it's default port.
Ansible is configured to run for the vagrant host and you can see the specified private IP in provisioning/hosts
.
If for some reason you want to use a different IP, be aware that you will need to update the Vagrantfile
as well as provisioning/hosts
.
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network :private_network, ip: "192.168.111.222"
end
Ansible installs the following packages:
- git
- nodejs
- mongodb
- yeoman
- generator-angular for yeoman
- express
- nginx
The mongodb and nginx services are started after provisioning takes place.
By default this repo disables directory syncing. If you wish to have this environment checked in as part of the dev process you can create your source directory in the top level of the project and uncomment this line in the Vagrantfile
:
# config.vm.synced_folder "src/", "/home/vagrant/path/to/your/project"
This will sync your source folders over SSH so you can develop on your host machine.
The file provisioning/group_vars/all
contains configurations for your install. This will allow you to configure project directories and things like nginx hostname and the port node js will run on.
For more on VM configuration options, check out the docs at Vagrant