Skip to content
Advertisement

Problems changing Ansible_Python_Interpreter

How can I change my ansible_python_interpreter value on Ubuntu?

I downloaded and installed Python 2.7.12 from tar, and now it’s running by default outside of Ansible

JavaScript
JavaScript

But when I try to set the variable, Ansible shows that it’s still using that newer version of Python (I need to use this older version to test)

JavaScript

Advertisement

Answer

It’s not possible to configure the version of Python used by Ansible on the controller.

ANSIBLE_PYTHON_INTERPRETER configuration parameter will set:

Path to the Python interpreter to be used for module execution on remote targets

The version of Python on controller depends on how Ansible has been built. For example

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement