david gond
david gond

Reputation: 51

How to set more than one ansible_python_interpreter variable in ansible

I use ansible programming api to manage passwords(update periodically based on pre-determined password) of lots of hosts,but hosts' python interpreter path is different,may be in /"usr/bin" or "/usr/local/bin",how can i tell ansible to try another when one path of them is not right?

Upvotes: 1

Views: 2549

Answers (1)

Konstantin Suvorov
Konstantin Suvorov

Reputation: 68289

You can't define multiple interpreters with ansible_python_interpreter, but I guess this should do the trick:

ansible_python_interpreter="/usr/bin/env python"

env is commonly used in scripts as shebang to detect actual interpreter's path.

Upvotes: 8

Related Questions