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? On Oct 31, 2017 14:19, "Tim Coote" <[email protected]> wrote: > 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? > > -- > 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 [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/packer-tool/6805c14d-7c98-4ecd-b741-dd66cf421dde%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/6805c14d-7c98-4ecd-b741-dd66cf421dde%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt9gKG74hd0ST%3D1owjiR3vmV8rus_JYOxnVT6DiV7ANzKA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
