ansible_python_interpreter for ad-hoc ansible commands

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

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.

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.

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 :slight_smile: