Monthly Archives: March 2017

Error running vagrant provisioner when default vagrant share is disabled

If you have disabled the default vagrant shared directory

[sourcecode language=’ruby’]
config.vm.synced_folder ‘.’, ‘/vagrant’, disabled: true
[/sourcecode]

You will get the following error using a provisioner:

[sourcecode]
==> default: Running provisioner: ansible_local…
default: Installing Ansible…
default: Running ansible-playbook…
cd /vagrant && PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ansible-playbook –limit="default" –inventory-file=/tmp/vagrant-ansible/inventory -v /ansible/init.yml
bash: line 3: cd: /vagrant: No such file or directory
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
[/sourcecode]

To fix, set the provisioning_path configuration:
[sourcecode language=’ruby’]
config.vm.provision “ansible_local” do |ansible|
ansible.provisioning_path = “/ansible”
end
[/sourcecode]