Getting failed to execute: ansible.legacy.setup

13,224 views
Skip to first unread message

Jade Foram

unread,
Jun 5, 2021, 12:36:04 PM6/5/21
to Ansible Project
Running ansible version 2.10.4 with Python 3.6.8 gives the following error:

fatal: [server001.example.ca]: FAILED! => {"ansible_facts": {}, "changed": false, "failed_modules": {"ansible.legacy.setup": {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "failed": true, "module_stderr": "Shared connection to server001.example.ca closed.\r\n", "module_stdout": "\r\nMOTD Message\r\n\r\n\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}}, "msg": "The following modules failed to execute: ansible.legacy.setup\n"}


The target server is RHEL 7.9 with with python 2.7.


Please help.

Jade Foram

unread,
Jun 6, 2021, 10:34:12 AM6/6/21
to Ansible Project
For anyone having this issue, here is the solution. 
The reason it was throwing that error was that the target server was using dzdo instead of sudo. Changing 
become_method = su to become_method = dzdo in ansible.cfg fixed the issue.
Reply all
Reply to author
Forward
0 new messages