Use Ansible-local with python3 from packer in aws

603 views
Skip to first unread message

Tim Coote

unread,
Oct 31, 2017, 9:19:26 AM10/31/17
to Packer
Is there a way to get the packer ansible-local provisioner to use python3?

I'd prefer to only support one version of python and I don't want to create instant legacy for a particular project by starting it with python2. Also, recent Ubuntu distros come only with python3 installed.

I've tried shell provisioning only with the python3 version of ansible, using pip3, rather than apt or pip. I've tried to get the ansible.cfg transferred to the staging directory with the playbook_dir parameter, and I've tried adding packer extra-vars via extra_arguments key for python_interpreter and ansible_playbook_interpreter.

for vagrant use, I just use `ansible_python_interpreter=/usr/bin/python3` in the [defaults] section of an ansible.cfg in the same directory as the playbook.

Is there any mechanism that _should_ work?

Rickard von Essen

unread,
Oct 31, 2017, 12:18:40 PM10/31/17
to packe...@googlegroups.com
There is not much magic here, packer just executes "ansible-playbook" (see https://www.packer.io/docs/provisioners/ansible-local.html#command).

Di you place the ansible.cfg in the correct directory? 

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/6805c14d-7c98-4ecd-b741-dd66cf421dde%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages