Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure in AWX playbook with gather_facts #4278

Closed
ricaragao opened this issue Jul 5, 2019 · 4 comments
Closed

Failure in AWX playbook with gather_facts #4278

ricaragao opened this issue Jul 5, 2019 · 4 comments
Labels

Comments

@ricaragao
Copy link

ricaragao commented Jul 5, 2019

ISSUE TYPE
  • Bug Report
SUMMARY

I have a task that use gather_facts to get info from one host CentOS. When I use my playbook with this task in AWX I receive this error:

fatal: [192.168.103.105]: FAILED! => {
    "ansible_facts": {}, 
    "changed": false, 
    "msg": "The following modules failed to execute: setup\n  setup: MODULE FAILURE\nSee stdout/stderr for the exact error\n"
}

It works fine if I run with ansible-playbook at shell

ENVIRONMENT
  • AWX version: 6.0.0
  • AWX install method: docker
  • Ansible version: 2.8.1
  • Operating System: CENTOS 7.6
  • Web Browser: Opera/Chrome
STEPS TO REPRODUCE
  • name: Switchover MySQL
    hosts:
    • host1
      remote_user: "myuser"
      become: yes
      become_method: sudo
      gather_facts: yes
      roles:
    • myrole1
EXPECTED RESULTS

facts

ACTUAL RESULTS
fatal: [192.168.103.105]: FAILED! => {
    "ansible_facts": {}, 
    "changed": false, 
    "msg": "The following modules failed to execute: setup\n  setup: MODULE FAILURE\nSee stdout/stderr for the exact error\n"
}
ADDITIONAL INFORMATION

ansible-playbook 2.8.1
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/var/lib/awx/.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-playbook
python version = 2.7.5 (default, Jun 20 2019, 20:27:34) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
Using /etc/ansible/ansible.cfg as config file
SSH password:
setting up inventory plugins
host_list declined parsing /tmp/awx_79_mkyh_1of/tmpx1ihxzae as it did not pass it's verify_file() method
Parsed /tmp/awx_79_mkyh_1of/tmpx1ihxzae inventory source with script plugin
statically imported: /var/lib/awx/projects/_13__mysql_switchover_master_slave/roles/mysql_replication/tasks/mysql_prepare_switchover.yml
statically imported: /var/lib/awx/projects/_13__mysql_switchover_master_slave/roles/mysql_replication/tasks/mysql_dump.yml
statically imported: /var/lib/awx/projects/_13__mysql_switchover_master_slave/roles/mysql_replication/tasks/mysql_switchover_only.yml
statically imported: /var/lib/awx/projects/_13__mysql_switchover_master_slave/roles/mysql_replication/tasks/mysql_stop_slave.yml
statically imported: /var/lib/awx/projects/_13__mysql_switchover_master_slave/roles/mysql_replication/tasks/mysql_start_new_slave.yml
statically imported: /var/lib/awx/projects/_13__mysql_switchover_master_slave/roles/mysql_replication/tasks/mysql_recreate_replication.yml
statically imported: /var/lib/awx/projects/_13__mysql_switchover_master_slave/roles/mysql_replication/tasks/mysql_stop_slave.yml
statically imported: /var/lib/awx/projects/_13__mysql_switchover_master_slave/roles/mysql_replication/tasks/mysql_start_new_slave.yml
Loading callback plugin awx_display of type stdout, v2.0 from /var/lib/awx/venv/awx/lib/python3.6/site-packages/ansible_runner/callbacks/awx_display.pyc
PLAYBOOK: site.yml *************************************************************
Positional arguments: site.yml
ask_pass: True
diff: True
remote_user: raragao
become_method: sudo
inventory: (u'/tmp/awx_79_mkyh_1of/tmpx1ihxzae',)
forks: 5
tags: (u'all',)
extra_vars: (u'@/tmp/awx_79_mkyh_1of/env/extravars',)
verbosity: 4
connection: smart
timeout: 10
1 plays in site.yml
PLAY [Switchover MySQL] ********************************************************
TASK [Gathering Facts] *********************************************************
task path: /var/lib/awx/projects/13__mysql_switchover_master_slave/site.yml:22
<192.168.103.105> ESTABLISH SSH CONNECTION FOR USER: raragao
<192.168.103.105> SSH: EXEC sshpass -d8 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="raragao"' -o ConnectTimeout=10 -o ControlPath=/tmp/awx_79_mkyh_1of/cp/2c02d608a6 192.168.103.105 '/bin/sh -c '"'"'echo ~raragao && sleep 0'"'"''
<192.168.103.105> (0, '/home/raragao\n', '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: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket "/tmp/awx_79_mkyh_1of/cp/2c02d608a6" does not exist\r\ndebug2: resolving "192.168.103.105" port 22\r\ndebug2: ssh_connect_direct: needpriv 0\r\ndebug1: Connecting to 192.168.103.105 [192.168.103.105] port 22.\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: fd 3 clearing O_NONBLOCK\r\ndebug1: Connection established.\r\ndebug3: timeout: 9999 ms remain after connect\r\ndebug1: permanently_set_uid: 0/0\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /root/.ssh/id_rsa type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /root/.ssh/id_rsa-cert type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /root/.ssh/id_dsa type -1\r\ndebug1: key

<192.168.103.105> ESTABLISH SSH CONNECTION FOR USER: raragao
<192.168.103.105> SSH: EXEC sshpass -d8 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="raragao"' -o ConnectTimeout=10 -o ControlPath=/tmp/awx_79_mkyh_1of/cp/2c02d608a6 192.168.103.105 '/bin/sh -c '"'"'( umask 77 && mkdir -p "echo /home/raragao/.ansible/tmp/ansible-tmp-1562291834.0-207669038118275" && echo ansible-tmp-1562291834.0-207669038118275="echo /home/raragao/.ansible/tmp/ansible-tmp-1562291834.0-207669038118275" ) && sleep 0'"'"''
<192.168.103.105> (0, 'ansible-tmp-1562291834.0-207669038118275=/home/raragao/.ansible/tmp/ansible-tmp-1562291834.0-207669038118275\n', '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: Applying 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_forwards: 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 = 7694\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 failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<192.168.103.105> Attempting python interpreter discovery
<192.168.103.105> ESTABLISH SSH CONNECTION FOR USER: raragao
<192.168.103.105> SSH: EXEC sshpass -d8 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="raragao"' -o ConnectTimeout=10 -o ControlPath=/tmp/awx_79_mkyh_1of/cp/2c02d608a6 192.168.103.105 '/bin/sh -c '"'"'echo PLATFORM; uname; echo FOUND; command -v '"'"'"'"'"'"'"'"'/usr/bin/python'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.7'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.6'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python3.5'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python2.7'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python2.6'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'/usr/libexec/platform-python'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'/usr/bin/python3'"'"'"'"'"'"'"'"'; command -v '"'"'"'"'"'"'"'"'python'"'"'"'"'"'"'"'"'; echo ENDFOUND && sleep 0'"'"''
<192.168.103.105> (0, 'PLATFORM\nLinux\nFOUND\n/usr/bin/python\n/usr/bin/python2.7\n/usr/libexec/platform-python\n/usr/bin/python\nENDFOUND\n', '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: Applying 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_forwards: 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 = 7694\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 failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<192.168.103.105> ESTABLISH SSH CONNECTION FOR USER: raragao
<192.168.103.105> SSH: EXEC sshpass -d8 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="raragao"' -o ConnectTimeout=10 -o ControlPath=/tmp/awx_79_mkyh_1of/cp/2c02d608a6 192.168.103.105 '/bin/sh -c '"'"'/usr/bin/python && sleep 0'"'"''
<192.168.103.105> (0, '{"osrelease_content": "NAME=\"CentOS Linux\"\nVERSION=\"7 (Core)\"\nID=\"centos\"\nID_LIKE=\"rhel fedora\"\nVERSION_ID=\"7\"\nPRETTY_NAME=\"CentOS Linux 7 (Core)\"\nANSI_COLOR=\"0;31\"\nCPE_NAME=\"cpe:/o:centos:centos:7\"\nHOME_URL=\"https://www.centos.org/\\"\\nBUG_REPORT_URL=\\"https://bugs.centos.org/\\"\\n\\nCENTOS_MANTISBT_PROJECT=\\"CentOS-7\\"\\nCENTOS_MANTISBT_PROJECT_VERSION=\\"7\\"\\nREDHAT_SUPPORT_PRODUCT=\\"centos\\"\\nREDHAT_SUPPORT_PRODUCT_VERSION=\\"7\\"\\n\\n", "platform_dist_result": ["centos", "7.6.1810", "Core"]}\n', '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: Applying 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_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\n…
Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/setup.py
<192.168.103.105> PUT /var/lib/awx/.ansible/tmp/ansible-local-76767UBHNw/tmprVYEXW TO /home/raragao/.ansible/tmp/ansible-tmp-1562291834.0-207669038118275/AnsiballZ_setup.py
<192.168.103.105> SSH: EXEC sshpass -d8 sftp -o BatchMode=no -b - -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="raragao"' -o ConnectTimeout=10 -o ControlPath=/tmp/awx_79_mkyh_1of/cp/2c02d608a6 '[192.168.103.105]'
<192.168.103.105> (0, 'sftp> put /var/lib/awx/.ansible/tmp/ansible-local-76767UBHNw/tmprVYEXW /home/raragao/.ansible/tmp/ansible-tmp-1562291834.0-207669038118275/AnsiballZ_setup.py\n', '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: Applying 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_forwards: 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 = 7694\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug2: Remote version: 3\r\ndebug2: Server supports extension "[email protected]" revision 1\r\ndebug2: Server supports extension "[email protected]" revision 2\r\ndebug2: Serv…
<192.168.103.105> ESTABLISH SSH CONNECTION FOR USER: raragao
<192.168.103.105> SSH: EXEC sshpass -d8 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="raragao"' -o ConnectTimeout=10 -o ControlPath=/tmp/awx_79_mkyh_1of/cp/2c02d608a6 192.168.103.105 '/bin/sh -c '"'"'chmod u+x /home/raragao/.ansible/tmp/ansible-tmp-1562291834.0-207669038118275/ /home/raragao/.ansible/tmp/ansible-tmp-1562291834.0-207669038118275/AnsiballZ_setup.py && sleep 0'"'"''
<192.168.103.105> (0, '', '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: Applying 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_forwards: 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 = 7694\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 failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<192.168.103.105> ESTABLISH SSH CONNECTION FOR USER: raragao
<192.168.103.105> SSH: EXEC sshpass -d8 ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="raragao"' -o ConnectTimeout=10 -o ControlPath=/tmp/awx_79_mkyh_1of/cp/2c02d608a6 -tt 192.168.103.105 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-jwsxqggbtczmeacacjjimddxslimhhaz ; /usr/bin/python /home/raragao/.ansible/tmp/ansible-tmp-1562291834.0-207669038118275/AnsiballZ_setup.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<192.168.103.105> (1, 'sudo: a password is required\r\n', '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: Applying 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_forwards: 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 = 7694\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 failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\nShared connection to 192.168.103.105 closed.\r\n')
<192.168.103.105> Failed to connect to the host via ssh: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: auto-mux: Trying existing master
debug2: fd 3 setting O_NONBLOCK
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_forwards: request forwardings: 0 local, 0 remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_client_request_alive: done pid = 7694
debug3: mux_client_request_session: session request sent
debug1: mux_client_request_session: master session id: 2
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 1
Shared connection to 192.168.103.105 closed.
fatal: [192.168.103.105]: FAILED! => {
"ansible_facts": {},
"changed": false,
"msg": "The following modules failed to execute: setup\n setup: MODULE FAILURE\nSee stdout/stderr for the exact error\n"
}
PLAY RECAP *********************************************************************
192.168.103.105 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

@awxbot awxbot added the type:bug label Jul 5, 2019
@sub2zero
Copy link

sub2zero commented Jul 6, 2019

Looks like you have problems with ssh connection, check credentials and inventory.

@ryanpetrello
Copy link
Contributor

Agreed with @sub2zero, this doesn't look like a bug to me.

@ricaragao
Copy link
Author

I understand your perception, but I run this exact playbook at same machine and works fine, but in AWX it fail. I'll try another playbook and tell for you.

@patrickkpowell
Copy link

I just had the same issue. It was on a VM I had just deployed and my user credentials required a different sudo password than other systems. Once I synced those up it worked.

ryanpetrello added a commit to ryanpetrello/awx that referenced this issue May 1, 2020
…-txt

[3.7.0] Keep awxkit's requirements on the setup.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants