# Ansible fails to pass a simple shell command to an AIX server : error message "SyntaxError: invalid syntax\\r\\n", "msg": "MODULE FAILURE"

**URL:** <https://forum.ansible.com/t/ansible-fails-to-pass-a-simple-shell-command-to-an-aix-server-error-message-syntaxerror-invalid-syntax-r-n-msg-module-failure/20428>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [February 2, 2016, 10:38pm UTC](https://forum.ansible.com/t/ansible-fails-to-pass-a-simple-shell-command-to-an-aix-server-error-message-syntaxerror-invalid-syntax-r-n-msg-module-failure/20428 "2016-02-02T22:38:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Coolman](https://avatars.discourse-cdn.com/v4/letter/c/c57346/32.png) [@Coolman](https://forum.ansible.com/u/Coolman)\
**Post date:** [February 2, 2016, 10:38pm UTC](https://forum.ansible.com/t/ansible-fails-to-pass-a-simple-shell-command-to-an-aix-server-error-message-syntaxerror-invalid-syntax-r-n-msg-module-failure/20428/1 "2016-02-02T22:38:57Z")

</div>

Hello there,  
I have the following error message when I run a simple playbook with (“ls -l” shell a command). Could help me to find out what is wrong here ?  
Below is the debug error message :

TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

\<192.168.14.224\> ESTABLISH SSH CONNECTION FOR USER: cissys

\<192.168.14.224\> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘IdentityFile=“/home/vagrant/.ssh/id\_rsa.cobolDeploy”’ -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=cissys -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.14.224 ‘( umask 22 && mkdir -p “$( echo $HOME/.ansible/tmp/ansible-tmp-1454436132.22-153236961992754 )” && echo “$( echo $HOME/.ansible/tmp/ansible-tmp-1454436132.22-153236961992754 )” )’

\<192.168.14.224\> PUT /tmp/tmp\_FdaTK TO /home/cissys/.ansible/tmp/ansible-tmp-1454436132.22-153236961992754/setup

\<192.168.14.224\> SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘IdentityFile=“/home/vagrant/.ssh/id\_rsa.cobolDeploy”’ -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=cissys -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r ‘[192.168.14.224]’

\<192.168.14.224\> ESTABLISH SSH CONNECTION FOR USER: cissys

\<192.168.14.224\> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o ‘IdentityFile=“/home/vagrant/.ssh/id\_rsa.cobolDeploy”’ -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=cissys -o ConnectTimeout=10 -o ControlPath=/home/vagrant/.ansible/cp/ansible-ssh-%h-%p-%r -tt 192.168.14.224 ‘LANG=en\_US.UTF-8 LC\_ALL=en\_US.UTF-8 LC\_MESSAGES=en\_US.UTF-8 PATH=/usr/bin/python:$PATH python /home/cissys/.ansible/tmp/ansible-tmp-1454436132.22-153236961992754/setup; rm -rf “/home/cissys/.ansible/tmp/ansible-tmp-1454436132.22-153236961992754/” \> /dev/null 2\>&1’

fatal: [192.168.14.224]: FAILED! =\> {“changed”: false, “failed”: true, “invocation”: {“module\_name”: “setup”}, “module\_stderr”: “OpenSSH\_6.9p1 Ubuntu-2ubuntu0.1, OpenSSL 1.0.2d 9 Jul 2015\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: /etc/ssh/ssh\_config line 19: 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 = 2455\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 192.168.14.224 closed.\r\n”, “module\_stdout”: " File "/home/cissys/.ansible/tmp/ansible-tmp-1454436132.22-153236961992754/setup", line 3160\r\n except OSError, e:\r\n ^\r\nSyntaxError: invalid syntax\r\n", “msg”: “MODULE FAILURE”, “parsed”: false}

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [February 3, 2016, 12:28pm UTC](https://forum.ansible.com/t/ansible-fails-to-pass-a-simple-shell-command-to-an-aix-server-error-message-syntaxerror-invalid-syntax-r-n-msg-module-failure/20428/2 "2016-02-03T12:28:49Z")

</div>

That error is due to the playbook running the setup module during the gather facts step and not having python2 available at /use/bin/Python but instead having python3.

If you are just trying to run script without running setup, add `gather_facts: false` to your play definition.

Otherwise you will need to ensure python2 is installed and that you provide its path via ansible\_python\_interpreter.
