I’m trying to use GNS3 to practice Ansible scripts, and I’m using the built-in version of Ansible from the “Network Automation” Docker instance. Unfortunately, this version of Ansible is still using Python 2.7.
I’ve tried using the command ansible-playbook --version -e 'ansible\_python\_interpreter=/usr/bin/python3'
to run a playbook with Python 3, and I’ve also tried specifying the ansible_python_interpreter
variable within the playbook:
- name: Common package
hosts: all
gather_facts: no
vars:
ansible_python_interpreter: /usr/bin/python3
roles:
- { role: python, tags: [ init, python, common, addusers] }
...
...
Is there any way I can permanently force Ansible to use Python 3?