Cheat Sheet Example Vagrantfile - Centos 7 With Apache Terms and Definitions
Cheat Sheet Example Vagrantfile - Centos 7 With Apache Terms and Definitions
Cheat Sheet Example Vagrantfile - Centos 7 With Apache Terms and Definitions
Vagrant.configure(2) do |config|
Commands
# Define what box to use (CentOS 7):
vagrant halt # Sync files between local src/ folder and guest /var/www/html folder:
>> Attempt a graceful shutdown of the guest machine(s)
config.vm.synced_folder "src/", "/var/www/html"
vagrant suspend
>> Suspend the machine(s) in its current state; does not shut down machine(s). # Provision guest with $samplescript variable; uses shell scripting:
vagrant resume
>> Start stopped guest machine(s), whether halted or suspended. config.vm.provision "shell", inline: $samplescript
vagrant reload # Set guest options for VirtualBox, including memory (1024), and CPU (2):
>> Reboot guest machine; the same as running vagrant halt then vagrant resume.
config.vm.provider "virtualbox" do |vb|
vagrant status
vb.memory = "1024"
>> View state of machines managed by Vagrant
vb.cpus = "2"
vagrant destroy end
>> Remove guest machine(s). end