Ansible+Mitogen ignores interpreter_python global variable
See original GitHub issueHello,
I’m running the Git version of Mitogen as of commit a60c6c14a2473c895162a1b58a81bad0e63d1718. It seems that after the changes in #658, Ansible+Mitogen respects the ansible_interpreter_python
variable, but not the [defaults]/interpreter_python
of ansible.cfg
, as described in https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html#interpreter-discovery. Although this can be easily worked around, I do find the current behaviour a bit confusing.
I’m running ansible 2.9.9+dfsg-1 from Debian unstable on my host:
$ ansible --version
ansible 2.9.9
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/james/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 3.8.5 (default, Aug 2 2020, 15:09:07) [GCC 10.2.0]
The target machines run Debian 10 with Python 2.7.16 and 3.7.3 installed.
Expected behaviour (strategy=linear)
$ ansible staging -m setup -a 'filter=ansible_python_version'
redacted.hostname | SUCCESS => {
"ansible_facts": {
"ansible_python_version": "3.7.3"
},
"changed": false
}
redacted.hostname | SUCCESS => {
"ansible_facts": {
"ansible_python_version": "3.7.3"
},
"changed": false
}
Behaviour with strategy=mitogen_linear:
$ ansible staging -m setup -a 'filter=ansible_python_version'
[WARNING]: Platform linux on host redacted.hostname is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
redacted.hostname | SUCCESS => {
"ansible_facts": {
"ansible_python_version": "2.7.16",
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false
}
[WARNING]: Platform linux on host redacted.hostname is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.
redacted.hostname | SUCCESS => {
"ansible_facts": {
"ansible_python_version": "2.7.16",
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false
}
Editted by @moreati: clarify variable vs config distinction.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:9
😱 oh no, I missed
interpreter_python
support when adding in #658 . Definitely a bug, not sure when I’ll be able to get to this but it’ll be fixed up at some point 👍 thanks for filing.Best solution is to make a group_vars/all.yml for each of your inventories, with: