Windows is not currently supported by Ansible which means the standard Ansible plugin provided with Vagrant cannot be used with this platform. The provision.sh script takes advantage of Vagrant's shell provisioning facilities to allow the use of Ansible from within a VM regardless of the host platform.
N.B. The script has only been tested on Debian Wheezy and will not work on an OS without the apt package manager.
Place provision.sh in the same directory as your Vagrantfile. You should then configure Vagrant to use shell provisioning where sh.path refers to provision.sh. Three options are required and must be supplied using sh.args in the following order:
- The directory the Ansible git repository should be cloned into
- The Ansible playbook to run
- The Ansible hosts inventory file to use
An example Vagrantfile is below:
Vagrant.configure("2") do |config|
# ...
config.vm.provision :shell do |sh|
sh.path = "provision.sh"
sh.args = "./ansible provisioning/setup.yml provisioning/hosts/dev_hosts"
end
end