"Platform linux on host #### is using the discovered Python interpreter at /usr/bin/python,

2,866 views
Skip to first unread message

Akshay Bora

unread,
Mar 9, 2021, 5:43:48 AM3/9/21
to AWX Project
Hi People,

I am running the ansible playbook through AWX and its getting failed with the subjected error. But the same playbook is running on other server successfully. Kindly help to resolve the issue.

{
    "ansible_facts": {},
    "msg": "The following modules failed to execute: setup\n",
    "failed_modules": {
        "setup": {
            "failed": true,
            "module_stdout": "  File \"/home/oracle/.ansible/tmp/ansible-tmp-1615285403.4958365-166725-83674126722203/AnsiballZ_setup.py\", line 72\r\n    with open(args_path, 'rb') as f:\r\n            ^\r\nSyntaxError: invalid syntax\r\n",
            "module_stderr": "Shared connection to ###### closed.\r\n",
            "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
            "rc": 1,
            "ansible_facts": {
                "discovered_interpreter_python": "/usr/bin/python"
            },
            "warnings": [
                "Platform linux on host###### 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."
            ]
        }
    },
    "_ansible_verbose_override": true,
    "_ansible_no_log": false,
    "changed": false

Akshay Bora

unread,
Mar 10, 2021, 1:53:36 AM3/10/21
to AWX Project
Can someone please help me on this?  If anyone has faced same issue and has resolution, please help.

Paweł Smolarz

unread,
Mar 10, 2021, 1:29:10 PM3/10/21
to AWX Project
Hi,

Please set ansible_python_interpreter as below for playbook. Then always the same python env will be used for shell execution and AWX - python related to ansible-playbook.

---
- name: A playbook for something
  hosts: localhost
  gather_facts: false
  vars:
    ansible_python_interpreter: "{{ ansible_playbook_python }}"

  tasks:


Regards,
Pawel
Reply all
Reply to author
Forward
0 new messages