setup module is failing

1,725 views
Skip to first unread message

Altif

unread,
Sep 21, 2021, 4:59:16 AM9/21/21
to Ansible Project
Hello,
I've ansible control node(CentOS 7) which is used to scp build image to target server(FreeBSD 11.04). It was just working fine last week. However, today I'd tried to run playbook, it got failed with below error message.

ansible-playbook -i zsdev-hosts Scp_build.yml --extra-vars build_version=<file-to-be-scp>

fatal: [zsdev-nrt-smca2]: FAILED! => {
    "ansible_facts": {},
    "changed": false,
    "failed_modules": {
        "setup": {
            "failed": true,
            "module_stderr": "Shared connection to X.X.X.X closed.\r\n",
            "module_stdout": "sudo: (null): option \"passprompt_override\" does not take a value\r\r\nsudo: error initializing audit plugin sudoers_audit\r\r\n",
            "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
            "rc": 1
        }
    },
    "msg": "The following modules failed to execute: setup\n"
}


Scp_build.yml playbook
===============
---
  - name: Build Transfer to remote machines
    hosts: zsdev
    tasks:
    - name: Start build Transfer to respective server
      shell:
        "sh /sc/build/copy_build_remote.sh {{ build_version }}"
...


zsdev-hosts Inventory file:
=================

[zsdev]
zsdev-nrt-smca2 ansible_host=X.X.X.X

[zsdev:vars]
ansible_ssh_extra_args='-o StrictHostKeyChecking=no'
ansible_python_interpreter = '/usr/local/bin/python'
ansible_user = zsroot
ansible_ssh_pass = 'somepassword'
ansible_port = 3223
gathering = none
ansible_connection = ssh
ansible_become = True
ansible_become_pass = 'somepassword'

ansible --version
ansible 2.9.21
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/maltif/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.5 (default, Jun 20 2019, 20:27:34) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

I'd tried to search, couldn't find anything, can someone please help me on this, any inputs are appreciated.

Regards,
Altif

Vladimir Botka

unread,
Sep 21, 2021, 6:04:18 AM9/21/21
to Altif, ansible...@googlegroups.com
On Tue, 21 Sep 2021 01:59:16 -0700 (PDT)
Altif <mohla...@gmail.com> wrote:

> fatal: [zsdev-nrt-smca2]: FAILED! => {
> ...
> "msg": "The following modules failed to execute: setup\n"
> }
> ...
>
> [zsdev]
> zsdev-nrt-smca2 ansible_host=X.X.X.X
>
> [zsdev:vars]
> ansible_ssh_extra_args='-o StrictHostKeyChecking=no'
> ansible_python_interpreter = '/usr/local/bin/python'

Is the version of Python at FreeBSD supported?
https://endoflife.date/python

Try

ansible_python_interpreter: /usr/local/bin/python3.6

Mohammad Altif

unread,
Sep 21, 2021, 9:12:30 AM9/21/21
to Vladimir Botka, ansible...@googlegroups.com
Thank you Vladimir for responding.
Yes, both Python2.7 and Python 3.7 are supported by FreeBSD. I tried with ansible_python_interpreter = '/usr/local/bin/python3' and encountered the same error.

fatal: [zsdev-nrt-smca2]: FAILED! => {
"ansible_facts": {},
"changed": false,
"failed_modules": {
"setup": {
"failed": true,
"module_stderr": "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Appl
ying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwa
rds: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done
pid = 2334\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header fa
iled: Broken pipe\r\ndebug2: Received exit status from master 1\r\nShared connection to X.X.X.X closed.\r\n",

"module_stdout": "sudo: (null): option \"passprompt_override\" does not take a value\r\r\nsudo: error initializing audit plugin sudoers_audit\r\r\n",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
},
"msg": "The following modules failed to execute: setup\n"
}
Kind Regards,
Mohammad Altif



steve missoh

unread,
Sep 21, 2021, 9:31:59 AM9/21/21
to Ansible Project
Strange,
especially if it was working b4. what has changed ?
Are u able to run sudo without issues on the remote host ?
Also check your sudoers file with visudo -c (on the remote node)

Matt Martz

unread,
Sep 21, 2021, 9:40:13 AM9/21/21
to ansible...@googlegroups.com
This may be of interest to you:  https://bugzilla.sudo.ws/show_bug.cgi?id=993

There was a bug in sudo 1.9.8 that has since been fixed.

--
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/af14c471-39a8-4c5f-b9df-4ce5bb07d747n%40googlegroups.com.


--
Matt Martz
@sivel
sivel.net

steve missoh

unread,
Sep 21, 2021, 9:59:13 AM9/21/21
to Ansible Project
very interesting, indeed Matt.
just checked and freebsd 11.4 ships with sudo 1.9.8 which is subject to the bug, this can be checked with sudo -p ' ' true
@Mohammad, I suggest you patch your sudo package to 1.9.8.p1; that will probably solve your issue. 

Vladimir Botka

unread,
Sep 21, 2021, 10:59:42 AM9/21/21
to Mohammad Altif, ansible...@googlegroups.com
On Tue, 21 Sep 2021 18:41:59 +0530
Mohammad Altif <mohla...@gmail.com> wrote:

> Yes, both Python2.7 and Python 3.7 are supported by FreeBSD.

In FreeBSD, Python 2.7 is not supported anymore but might work. I
tested old 10.3 and it is working with 2.7. The controller is CentOS
8, Ansible 2.9 and Python 3.6

$ cat /etc/redhat-release
CentOS Linux release 8.4.2105

$ ansible --version
ansible 2.9.23
...
location = /usr/bin/ansible python version = 3.6.8 (default, Mar 19
2021, 05:13:41) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]

$ ansible host1 -m setup | grep ansible_python_version
"ansible_python_version": "2.7.13"

From your data it's not possible to say what is the problem. To move
forward, minimize your setup and locate the problem. See
Troubleshooting Guide
https://docs.ansible.com/ansible/latest/network/user_guide/network_debug_troubleshooting.html

1) Are yo able connect to the remote host? $ ssh admin@host
2) Are you able to ping it? $ ansible host -u admin -m ping
3) Are you able to run setup? $ ansible host -u admin -m setup
4) Try with Python >= 3.6
...

--
Vladimir Botka

Mohammad Altif

unread,
Sep 21, 2021, 12:30:49 PM9/21/21
to Vladimir Botka, ansible...@googlegroups.com
Thanks again Vladimir. I'd tried following troubleshooting guide, here is the results:

Ansible Control Node
==================
1) Are you able to connect to the remote host? $ ssh admin@host -- remote host is accessible with ssh
2) Are you able to ping it? $ ansible host -u admin -m ping -- No, "getting he following modules failed to execute: setup\n" error
3) Are you able to run the setup? $ ansible host -u admin -m setup -- No, getting "he following modules failed to execute: setup\n" error
4) Try with Python >= 3.6 -- tried with /usr/local/bin/python3(3.7.10) as well

$ ansible --version

ansible 2.9.21
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/maltif/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Jun 20 2019, 20:27:34) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]


$ cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)


Kind Regards,
Altif



Altif

unread,
Sep 21, 2021, 2:38:43 PM9/21/21
to Ansible Project
Thank you so much Vladimir, Matt and Stefi... as Matt pointed that there is bug in sudo-1.9.8. Once upgrading to  sudo-1.9.8p1, issue got resolved.

Thanks again for helping me out, truly appeciated :)

Stay safe and healthy!

Altif

unread,
Sep 21, 2021, 2:42:58 PM9/21/21
to Ansible Project
I'm sharing the steps which I'd followed to troubleshoot and resolved the issue:
sudo -p '' true
if not output, all good 
else below output
sudo: (null): option "passprompt_override" does not take a value
sudo: error initializing audit plugin sudoers_audit

#check sudoer file parsing
visudo -c

#check sudo version
sudo -V

#backup existing sudoers file
cp /usr/local/etc/sudoers /sc/build/

#download sudo package:
tar -xvf sudo-1.9.8p1.tar.gz &&  cd sudo-1.9.8p1

./configure --build=amd64-unknown-freebsd24
make
make install
cp sudoers /etc/sudoers && cp sudoers /usr/local/etc/sudoers

Hope, it'd help someone.
Reply all
Reply to author
Forward
0 new messages