Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Ansible Received exit status from master 1. SyntaxError: invalid syntax

Below is my ansible inventory host file:

host2 ansible_ssh_common_args="-t -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null  -o StrictHostKeyChecking=no" ansible_shell_executable=/bin/bash ansible_shell_type=sh ANSIBLE_HOST_KEY_CHECKING=false ansible_ssh_private_key_file=/tmp/privatekey  USER_RUN=appuser

When i run ansible-playbook it fails with the below error:

23:16:08 ESTABLISH SSH CONNECTION FOR USER: user2 23:16:08 SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/tmp/privatekey"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=user2 -o ConnectTimeout=10 -t -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ControlPath=/home/user1/.ansible/cp/5d9cf4adc1 -tt host2 '/bin/bash -c '"'"'/usr/bin/python /home/user2/.ansible/tmp/ansible-tmp-1544501766.15-34113910423848/AnsiballZ_setup.py && sleep 0'"'"'' 23:16:08 (1, ' File "/home/user2/.ansible/tmp/ansible-tmp-1544501766.15-34113910423848/AnsiballZ_setup.py", line 39\r\n with open(module, \'wb\') as f:\r\n ^\r\nSyntaxError: invalid syntax\r\n', 'OpenSSH_7.7p1 (CentrifyDC build 5.5.1-395) , OpenSSL 1.0.2o-fips 27 Mar 2018\r\ndebug1: Reading configuration data /home/user1/.ssh/config\r\ndebug1: Reading configuration data /etc/centrifydc/ssh/ssh_config\r\ndebug1: /etc/centrifydc/ssh/ssh_config line 3: 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 = 25945\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 host2 closed.\r\n') 23:16:08 ESTABLISH SSH CONNECTION FOR USER: user2 23:16:08 SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/tmp/privatekey"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=user2 -o ConnectTimeout=10 -t -o ControlMaster=auto -o ControlPersist=60s -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ControlPath=/home/user1/.ansible/cp/5d9cf4adc1 host2 '/bin/bash -c '"'"'rm -f -r /home/user2/.ansible/tmp/ansible-tmp-1544501766.15-34113910423848/ > /dev/null 2>&1 && sleep 0'"'"'' 23:16:08 (0, '', 'OpenSSH_7.7p1 (CentrifyDC build 5.5.1-395) , OpenSSL 1.0.2o-fips 27 Mar 2018\r\ndebug1: Reading configuration data /home/user1/.ssh/config\r\ndebug1: Reading configuration data /etc/centrifydc/ssh/ssh_config\r\ndebug1: /etc/centrifydc/ssh/ssh_config line 3: 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 = 25945\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\nShared connection to host2 closed.\r\n') 23:16:08 fatal: [host2]: FAILED! => { 23:16:08 "changed": false, 23:16:08 "module_stderr": "OpenSSH_7.7p1 (CentrifyDC build 5.5.1-395) , OpenSSL 1.0.2o-fips 27 Mar 2018\r\ndebug1: Reading configuration data /home/user1/.ssh/config\r\ndebug1: Reading configuration data /etc/centrifydc/ssh/ssh_config\r\ndebug1: /etc/centrifydc/ssh/ssh_config line 3: 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 = 25945\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 host2 closed.\r\n", 23:16:08 "module_stdout": " File \"/home/user2/.ansible/tmp/ansible-tmp-1544501766.15-34113910423848/AnsiballZ_setup.py\", line 39\r\n with open(module, 'wb') as f:\r\n ^\r\nSyntaxError: invalid syntax\r\n", 23:16:08 "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", 23:16:08 "rc": 1 23:16:08 } 23:16:08 to retry, use: --limit @/opt/scripts/site.retry 23:16:08 23:16:08 PLAY RECAP ********************************************************************* 23:16:08 host2 : ok=0 changed=0 unreachable=0 failed=1

    ansible --version
ansible 2.7.1
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/user1/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible

Comments