I have a Vagrantfile that is simplified to:
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.boot_timeout = 900
config.vm.define 'srv' do |srv|
srv.vm.provision 'ansible' do |ansible|
ansible.compatibility_mode = '2.0'
ansible.playbook = 'playbook.yml'
end
end
end
When I run vagrant provision, at the Gathering Facts stage, I get /usr/bin/python: not found because Ubuntu 16.04 by default only has python3 not Python 2.x python installed.
I see several older posts about this. It seems recent versions of Ansible support using Python 3, but it must be configured via ansible_python_interpreter=/usr/bin/python3 in the hosts file or on the ansible command line. Is there any way I specify this option in my Vagrantfile or in my playbook.yml file? I'm currently not using a hosts file, I'm not running ansible-playbook via command line, I'm running Ansible through the Vagrant integration.
FYI, I'm using Ansible 2.4.1.0 and Vagrant 2.0.1, which are the latest versions as of this writing.