Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[WIP] Automatically detect interpreters (alternate approach) #42783
This commit adds an action plugin called 'gather_interpreters' and runs it automatically as part of play fact gathering. This plugin uses 'which' (on platforms where it's supported) to find the full path of a list of possible interpreter names and sets the appropriate 'ansible_x_interpreter' var.
Overall this is the approach that I was discussing at some point. The biggest difference is that I think instead of trying to use
And instead of an action I was using a new block, calling the raw module in a block/rescue/finally manner.
Anyway, just ideas.
This implementation can be used for interpreters other than python by adding them to the list, and trying to parse version numbers from a bunch of arbitrary interpreters doesn't sound pleasant.
I opted for an action plugin so that the action could be performed again arbitrarily, like is currently possible for