Vagranrt Flashcards
Vagrant
Used for building and managing virtual machine environment, DevProd parity.
Provisioned on top of provider. Such as shell scn, Chef, Puppet.
OoB: VirtualBox, Hyper-V, Docker.
Custom providers supported.
vagrant init
Initializes current directory to be vagrant environment by creating a vagrant file. -f: force overwrite of vagrant file. -m: minimal file generation. —output : output path. —template : template path.
vagrant up
Creates and configures guest machines to Vagrant file.
-h: help
—provision: force provisioner to run
—provision-with: force given provisioners to run
—destroy-on-error: Destroy machine if fatal error occurs. Default.
—parallel: enable/disable parallelism.
—install-provider: attempt to install provider if not installed. Default.
vagrant destroy
Stops running and destroys all resources created.
-f: destroy without confirmation.
—parallel: enables/disables, but automatically forces.
vagrant validate
Validates Vagrant file.
vagrant provision
Runs any configured provisioners.
vagrant reload
Runs vagrant halt and vagrant up.
—provision:
—provision-with:
vagrant ssh
ssh into Vagrant machine.
- c: execute given command directly
- p: plain. Authentication to user.
- t: enables
vagrant status
Output the status of all vagrant instances if not given name id.
vagrant halt
Attempt to shut down Vagrant.
-f: force shut down.
Vagrant file stuff
Repeat DO-1
vagrant ssh-config
Prints ssh info for host.
Boxfile
Package form for Vagrant environment. Documentation form in DO-1.
vagrant box
add: —clean
list: -i: info
outdated: —global
prune:
remove:
repackage: provide name provider and version to complete.
update: download and install new box, with no changes to running.
vagrant box prune
—dry-run: —provider: —name -f repackage