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 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) 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

I get the message: “The pexpect python module is required” when running pexpect module on ansible

I am very new to ansible and I am trying to run a playbook to change root password of hosts so I am using the expect command of pexpect module. I successfully managed to install pexpect v4.7 with python 2.7 on the hosts and on the local server running the playbook. However when the playbook is being run, it fails with error: “The pexpect python module is required” According to the requirements, pexpect and python are of the correct version The playbook is as follows: Am I doing something wrong? Please help! Answer I managed to fix the issue by