For a test, I set up a very simple Vagrant file. This is just to test how working with Ansible is. Sadly I am stuck at step number 2 with the following error during
vagrant up --provision (which I can repeat on
'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.
The Debugging Efforts so far
As the Ubuntu 14 "Trusty" 64bit box comes without Ansible installed, I added a quick shell script to run as provisioner before the actual Ansible playbooks. Here's the
Vagrant.require_version ">= 1.7.0" Vagrant.configure("2") do |config| config.vm.box = "ubuntu/trusty64" config.ssh.insert_key = false # Synced folders config.vm.synced_folder "./public", "/var/www", disabled: false # Install Ansible config.vm.provision :shell, path: "provisioners/shell/install-ansible.sh" # Run Ansible Playbooks config.vm.provision "ansible" do |ansible| ansible.verbose = "vvv" ansible.playbook = "provisioners/ansible/playbook.yml" end end
The bash script
install-ansible.sh is as simple as this:
sudo apt-get install software-properties-common sudo apt-add-repository ppa:ansible/ansible sudo apt-get -y update sudo apt-get install ansible
To confirm that
ansible are installed, I
vagrant sshed into the box and called
which ansible-playbook and
which ansible. Both are available:
$ which ansible # /usr/bin/ansible
dpkg -L ansible, I find plenty of stuff going on in
python --version gives me
Python 2.7.6 while the minimum required version is 2.4.
echo $PATH gives the following default output:
I can confirm, that the user is the correct one:
whoami results in
vagrant and the last command executed before the error is:
PYTHONUNBUFFERED=1 ANSIBLE_HOST_KEY_CHECKING=false ANSIBLE_FORCE_COLOR=true ANSIBLE_SSH_ARGS='-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --user=vagrant --connection=ssh --timeout=30 --limit='default' --inventory-file=/Users/*****/projects/*****/.vagrant/provisioners/ansible/inventory -vvv provisioners/ansible/playbook.yml
I am out of ideas here.