Could we read the ansible_python_interpreter from an environment variable?

You can set the ansible_python_interpreter for a host in the inventory file, but it would be nice if I it would read this in from an $ANSIBLE_PYTHON_INTERPRETER environment variable. I use homebrew-ed Python on my local machine, and I’d love to just add a line to my dotfiles instead of having to add

[local]
localhost ansible_python_interpreter=/usr/local/bin/python

to an inventory file for each playbook. Is there another way I should be doing this? Does anyone else have any thoughts? If it seems like a good idea I’d be happy to try and put something together.

Thanks!
Josh Conner

It wouldn’t make a lot of sense as an environment variable because it’s designed to differ on a server by server basis.

You definitely don’t have to have a different inventory for each playbook either, just pass the same inventory in with -i.