Cheatography
https://cheatography.com
Setup vagrant network for ansible
Vagrant Use Commands [Run in Project Directory]vagrant init | | initializes a new vagrantfile | vagrant init hashicorp/precise64 | | new vagrantfile based on existing box | vagrant up | vagrant ssh | vagrant suspend | vagrant resume | vagrant halt | vagrant reload | | restarts box w/ new configuration | vagrant destroy | | destroys current endpoint not the base box | vagrant --version |
Vagrant Share/Remote Accessvagrant share | | share your environment with anyone | vagrant connect | | connect to a shared end point | vagrant hosts | | all hostnames managed by plugin | vagrant hostmanager | | manages /etc/hosts within a multi machine environment | vagrant ssh-config | | provides connect config for machine | vagrant rdp | | connects to other machine via rdp |
Customizationvagrant.configure ("2") do |config| config.vm.box = "hashicorp/precise64" # guest is the VM; host is your computer end config.vm.network "forwarded_port", guest: 80, host: 8080 config.vm.provision :shell, path: "my_bash_script.sh" # path is relative to your Vagrantfile end | By default ./ on your computer is shared as /vagrant on the vm; allowing other to access your VM |
Vagrant SetupRelocate Vagrant_Home from: \user\.vagrant.d to: C:\Vagrant_Home | From an Elevated Prompt | setx VAGRANT_HOME "C:\Vagrant_Home" /M |
Create Base Boxesvagrant provision | | | vagrant push | | deploys code to a configured destination | vagrant package | | creates a box from a working environment | pe-build | | command related to a pe installation |
| | Vagrant Box Mgmtvagrant box list | | lists all available boxes | vagrant status | | status of current vagrant end point | vagrant global-status | | status of all vagrant endpoints | vagrant global-status prune | | status of all boxes; dropping invalid entries | vagrant box remove | | deletes a copied end point | vagrant provision | | forces end point to re-provision | vagrant reload --provision | | restart end point forcing provisioning | vagrant provision --debug | | increases verbosity during debug | vagrant up --provision | tee provision.log | vagrant box outdated | | checks for box updates | enable VBGuest auto update |
HashiCorpLinux Base Boxes [vagrant box add] | - hashicorp/precise64 | - bento/centos-7 | - bento/ubuntu-16.04 | - ubuntu/trusty64 |
Windows Base Box [vagrant box add]
Vagrant Pluginsvagrant plugin | manages all plugins | vagrant plugin install vagrant-vbguest | vagrant plugin install vagrant-hostmanager | - manages /etc/hosts within a multi machine environment | vagrant plugin install vagrant-env |
Vagrant Logsvagrant up --provision | tee provision.log | forces provisioning and writes a log | vagrant_log=info vagrant up | use env var VAGRANT_LOG to set verbosity |
Customize the VagrantfileConfigure Base Boxes | Vagrant.configure("2") do |config| config.vm.box = "hashicorp/precise64" end | Set base box with version number | Vagrant.configure("2") do |config| config.vm.box = "hashicorp/precise64" config.vm.box_version = "1.1.0" end | via url | Vagrant.configure("2") do |config| config.vm.box = "hashicorp/precise64" config.vm.box_url = "https://vagrantcloud.com/hashicorp/precise64" |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets