I have created a Vagrantfile to provision a new box using Ansible. Both the Vagrantfile and the Ansible playbooks are ones I've used before, prior to an upgrade to OS X Yosemite. I can successfully vagrant up
but when I try to vagrant provision
I get the following error:
➜ NNL vagrant provision
==> default: Running provisioner: ansible...
The executable 'ansible-playbook' Vagrant is trying to run was not
found in the PATH variable. This is an error. Please verify
this software is installed and on the path.
Update 2: Here's the verbose (vvvv) output for the command above:
➜ ta vagrant provision
==> default: Running provisioner: ansible...
ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false PYTHONUNBUFFERED=1 ANSIBLE_SSH_ARGS='-o
ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --private-
key=/Users/mike/.vagrant.d/insecure_private_key --user=vagrant --connection=ssh --
limit='default' --inventory-file=/Users/mike/Desktop/ta/.vagrant/provisioners/ansible/inventory
-vvvv vagrant.yml
The executable 'ansible-playbook' Vagrant is trying to run was not
found in the PATH variable. This is an error. Please verify
this software is installed and on the path.
I have already updated ansible and vagrant as part of my troubleshooting:
➜ NNL ansible --version
ansible 1.8.1
configured module search path = None
➜ NNL ansible-playbook --version
ansible-playbook 1.8.1
configured module search path = None
➜ NNL vagrant --version
Vagrant 1.6.5
Ansible is definitely installed and /usr/local/bin is on the PATH environment variable.
➜ NNL which ansible
/usr/local/bin/ansible
➜ NNL echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
Update 1: Here's my Vagrantfile, I've cut it back to the bare minimum:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.hostname = "NNL"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.network :forwarded_port, guest: 3000, host: 3000
config.vm.network :forwarded_port, guest: 9200, host: 9200
config.ssh.forward_agent = true
config.vm.provision "ansible" do |ansible|
ansible.playbook = "vagrant.yml"
end
end
My other thought was that I'm using zsh and perhaps vagrant is executing commands through bash or some other shell, so I also tried to add a .bashrc file to ensure that /usr/local/bin was on the path for that shell too. It appears to be, but I still get the same error:
➜ NNL bash
bash-3.2$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
bash-3.2$ which ansible
/usr/local/bin/ansible
I'm at a loss now as to how to proceed. As a footnote, my other vagrant boxes which I created successfully under Mavericks also now fail with the same error when I try to re-provision them.
ansible.verbose = "vvvv"
below theansible.playbook
setting so that we can get the full command vagrant is trying to run – codeaken