Now using /usr/bin/env python vs /usr/bin/python to work better with virtualenv, etc

54 views
Skip to first unread message

Michael DeHaan

unread,
Mar 26, 2012, 10:27:58 PM3/26/12
to ansible...@googlegroups.com
I received quite a few requests for this.

For those looking, it's in place now in the latest git source.

--Michael

Carl Wolff

unread,
Sep 7, 2012, 7:32:16 AM9/7/12
to ansible...@googlegroups.com
Would it be possible to define the python binary in a playbook?
"env python" is perfect as long as the binary is named "python".
However, during my test on a mips-host (Tomato router), i got an error since the binary is named python2.6

It would be super if this could be configured easily...

Carl Wolff

unread,
Sep 7, 2012, 7:33:18 AM9/7/12
to ansible...@googlegroups.com
I add the result Daniel Hozac gave me: use ansible_python_interpreter

Jan-Piet Mens

unread,
Sep 7, 2012, 7:38:35 AM9/7/12
to ansible...@googlegroups.com
> Would it be possible to define the python binary in a playbook?
> "env python" is perfect as long as the binary is named "python".
> However, during my test on a mips-host (Tomato router), i got an error
> since the binary is named python2.6
>
> It would be super if this could be configured easily...

For example, in your inventory file:

$ cat hosts
your.tomato.router ansible_python_interpreter=/some/path/python2.6/bin/python

I learned that recently and it's saved my bacon ;-)

-JP
Reply all
Reply to author
Forward
0 new messages