Hi All,

Basically, I'm trying to run a python script on a host. I have a playbook 
that's using the script module and it works when I target Oracle Enterprise 
Linux 6.7. However, trying it against a Solaris host fails. This is 
peculiar to me because I can copy the python script to the Solaris box and 
run it no problem. Running the script targeting the Solaris host with the 
ansible-playbook command gets me:

TASK [Running script on host] 
**************************************************

fatal: [hostnamehere.whatever.com]: FAILED! => {"changed": true, "failed": 
true, "rc": 127, "stderr": "", "stdout": "/usr/bin/env: No such file or 
directory\r\n", "stdout_lines": ["/usr/bin/env: No such file or directory"]}


So basically, no such file or directory? I'm assuming the "/usr/bin/env" is 
from the first line of the Python script:


#!/usr/bin/env python


Which, from my understanding is supposed to make sure to use whatever 
Python is applicable as Python can be installed in different paths. If 
Ansible can't find it, what can I do?


When I do an echo $PATH on the Solaris host I can see /usr/local/bin/ and 
Python on the Solaris box is /usr/local/bin/python (Python also works when 
I just type 'python' on the Solaris host). So I tried changing the script's 
first line to:


#!/usr/local/bin/python


And now it can run (but now breaks when I run it on the Oracle Enterprise 
Linux box). Not really sure what else I can do asides from point to 
different scripts with different first lines in the python script. 


Hoping someone can shine some light on how I can implement this elegantly, 
thanks!

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/69d075d6-da64-42fc-a2ea-d58780d64b6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to