Connection to Target server Failing

13 views
Skip to first unread message

GOPABANDHU DASH

unread,
Jul 27, 2020, 12:26:24 PM7/27/20
to Ansible Project
Hi,

I am getting below error when i am trying to connect to my target server

fatal: [hostname]: FAILED! => {"changed": false, "module_stderr": "Connection to hostname closed.\r\n", "module_stdout": "  File \"/home/gopa/.ansible/tmp/ansible-tmp-1595866958.593897-39491564121298/AnsiballZ_setup.py\", line 39\r\n    with open(module, 'wb') as f:\r\n            ^\r\nSyntaxError: invalid syntax\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

My target having python 2.7.2 version.

Also i tried by setting remote_tmp     = /tmp/ansible-$USER. Also getting the same issue.

Please help

Dick Visser

unread,
Jul 27, 2020, 5:14:38 PM7/27/20
to ansible...@googlegroups.com
Ansible version?
Target os?
Playbook?
Invocation and arguments?
Inventory?

Please send 


--
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/22cc69fd-fb26-426c-ac96-9d175774ccaeo%40googlegroups.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

GOPABANDHU DASH

unread,
Jul 27, 2020, 7:23:53 PM7/27/20
to Ansible Project
Issue got resolved after changing the ansible_python_interpreter=/usr/local/bin/python. I am using redhat version 5 where two different python version python2.4 and python2.7 is available. Python2.4 is in default location /usr/bin and python2.7 is in /usr/local/bin/python. After some research i found ansible automatic use the default interpreter which is /usr/bin that the reason i was getting issue After changing that variable issue got resolved. 

Anyway Thanks for the quick response. Really appreciated. 


On Tuesday, July 28, 2020 at 2:44:38 AM UTC+5:30, Dick Visser wrote:
Ansible version?
Target os?
Playbook?
Invocation and arguments?
Inventory?

Please send 

On Mon, 27 Jul 2020 at 18:26, GOPABANDHU DASH <gopaba...@gmail.com> wrote:
Hi,

I am getting below error when i am trying to connect to my target server

fatal: [hostname]: FAILED! => {"changed": false, "module_stderr": "Connection to hostname closed.\r\n", "module_stdout": "  File \"/home/gopa/.ansible/tmp/ansible-tmp-1595866958.593897-39491564121298/AnsiballZ_setup.py\", line 39\r\n    with open(module, 'wb') as f:\r\n            ^\r\nSyntaxError: invalid syntax\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

My target having python 2.7.2 version.

Also i tried by setting remote_tmp     = /tmp/ansible-$USER. Also getting the same issue.

Please help

--
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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages