Boilerplate project for creating VMs with custom user configurations.
- VirtualBox (5.0.0 or later)
- Vagrant (1.7.4 or later)
- vagrant-hostmanager (1.6.1 or later)
- Guest Additions (4.3.22 or later)
- Puppet (4.2.1 or later)
- Ruby (2.1.6 or later)
$ vagrant plugin install vagrant-hostmanager // this is required only once
$ mkdir project // the directory name will be used later on so chose it carefully
$ cd project
$ mkdir code // this directory will hold the app's code
$ git clone [email protected]:radub/roadster.git
right now if you run ls -la
in the project directory you should get:
total 0
drwxr-xr-x 5 user staff 170 Oct 28 16:13 .
drwxr-xr-x 6 user staff 204 Oct 28 14:53 ..
drwxr-xr-x 31 user staff 1054 Nov 9 12:32 code
drwxr-xr-x 10 user staff 340 Oct 28 14:58 roadster
You are now ready to spin-up the VM! Step into the car and start the engine!
$ cd roadster
$ vagrant up
go grab a coffee ... :) then come back. You will be prompted for the administrator password. The script also takes care of updating the /etc/hosts
file.
Open your browser and access: http:\\project.local
.
That's it!
Typing vagrant
from the command line will display a list of all available commands.
Be sure that you are in the same directory as the Vagrantfile when running these commands!
vagrant up
-- starts vagrant environment (also provisions only on the FIRST vagrant up)vagrant status
-- outputs status of the vagrant machinevagrant halt
-- stops the vagrant machinevagrant reload
-- restarts vagrant machine, loads new Vagrantfile configurationvagrant provision
-- forces reprovisioning of the vagrant machinevagrant ssh
-- connects to machine via SSHvagrant destroy
-- stops and deletes all traces of the vagrant machine
vagrant -v
-- Get the vagrant versionvagrant global-status
-- outputs status of all vagrant machinesvagrant suspend
-- Suspends a virtual machine (remembers state)vagrant resume
-- Resume a suspended machine (vagrant up works just fine for this as well)vagrant reload --provision
-- Restart the virtual machine and force provisioningvagrant provision --debug
-- Use the debug flag to increase the verbosity of the outputvagrant push
-- Yes, vagrant can be configured to deploy code!vagrant up --provision | tee provision.log
-- Runsvagrant up
, forces provisioning and logs all output to a file