Basic Usage of Provisioners
Basic Usage of Provisioners
While Vagrant offers multiple options for how you are able to provision your machine, there is a standard usage pattern as well as some important points common to all provisioners that are important to know.
Configuration
First, every provisioner is configured within your Vagrantfile using the config.vm.provision
method call. For example, the Vagrantfile below enables shell provisioning:
Vagrant.configure("2") do |config| # ... other configuration config.vm.provision "shell", inline: "echo hello" end
Every provisioner has a type, such as "shell"
, used as the first parameter to the provisioning configuration. Following that is basic key/value for configuring that specific provisioner. Instead of basic key/value, you can also use a