Python_Interpreter_Error.

308 views
Skip to first unread message

Akshay Bora

unread,
Mar 10, 2021, 1:57:40 AM3/10/21
to Ansible 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

Dick Visser

unread,
Mar 10, 2021, 3:43:20 AM3/10/21
to ansible...@googlegroups.com
On Wed, 10 Mar 2021 at 07:57, Akshay Bora <akshay...@gmail.com> wrote:
>
> 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.

This means it's not an ansible issue, but rather an AWX issue. Please
use the dedicated AWX list: https://groups.google.com/g/awx-project

Abhijeet Kasurde

unread,
Mar 10, 2021, 3:55:15 AM3/10/21
to ansible...@googlegroups.com
it seems that you are using python 2.6 since there is a syntax error for "with" syntax. Try updating the Python version to the latest.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwNCBm1seRO8%2B6WyLDgvGho1rzJPfSkig1Ck0fZv8FOb0g%40mail.gmail.com.



--
Thanks,
Abhijeet Kasurde

Nuno Jordão

unread,
Mar 10, 2021, 10:01:01 AM3/10/21
to ansible...@googlegroups.com
Aren't the modules supposed to work with python 2.6? He is running the setup module...
Probably the behaviour is different because the Ansible versions are different between the Ansible inside AWX and the Ansible in the server. 
That info is lacking from OP. As is the OS version of the managed server...

Reply all
Reply to author
Forward
0 new messages