ansible_python_interpreter for ad-hoc ansible commands

171 views
Skip to first unread message

Walid

unread,
Jan 14, 2014, 7:53:17 AM1/14/14
to ansible...@googlegroups.com
Hi,

What would be the best way to set ansible_python_interpreter for almost 50% of the hosts in the inventory for ad-hoc ansible command.  what i did is i grouped them under one group in the inventory [python27:children] and have set the vars for this group [python27:vars]
ansible_python_interprete=/path/to/python27/bin/python27

it is working, however i am not sure if that is the best way to do it, how would you do it?

kind regards

Walid

Michael DeHaan

unread,
Jan 14, 2014, 8:26:32 AM1/14/14
to ansible...@googlegroups.com
This would be a fine way to do it.

I'd probably just associate it with a group named after the OS if that were me, but maybe it's not OS specific in your case.





--
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 post to this group, send email to ansible...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Michael DeHaan <mic...@ansibleworks.com>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

Walid

unread,
Jan 14, 2014, 8:30:32 AM1/14/14
to ansible...@googlegroups.com
Hi Michael,

that is what i have done eventually, created a group for RHEL5 and add the possible groups that use rhel5 under it to get the variable.

thanks,

W.

Michael DeHaan

unread,
Jan 14, 2014, 8:32:03 AM1/14/14
to ansible...@googlegroups.com
For information of other users, RHEL 5 should be fine if you just install python-simplejson for usage of most modules.

However if you have python27 installed that's good too :)

Reply all
Reply to author
Forward
0 new messages