Is there a way to do this? I have a playbook with two tasks.
The first task uses Yum module (and python 2 interpreter). The next task uses
aws_s3 module (and python3 interpreter), but fails because the playbook is still trying
to use python2 interpreter. (the error is: can't find boto3...)
I tested this by using two separate Playbooks and declaring
the appropriate python interpreter at the Playbook level:
Each task worked in a separate playbook. but I would rather use a single playbook for both Tasks.
Is it possible to set the "ansible_python_interpreter" at the Task
level - With a keyword or variable or
something?
- name: my task
ping:
vars:
ansible_python_interpreter: /usr/bin/python