Skip interpreter discovery for network OSs(#74012)
skip python interpreter discovery on network os being set as this indicates a 'forced local' module and should use sys.executable.
This commit is contained in:
parent
51b5659598
commit
173d0a8de7
2 changed files with 8 additions and 0 deletions
2
changelogs/fragments/tweaking_interpreter_discovery.yaml
Normal file
2
changelogs/fragments/tweaking_interpreter_discovery.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- interpreter discovery is now handling special (ansible_network_os) cases in less noisy ways.
|
|
@ -539,6 +539,12 @@ class TaskExecutor:
|
|||
plugin_vars = self._set_connection_options(cvars, templar)
|
||||
templar.available_variables = orig_vars
|
||||
|
||||
# TODO: eventually remove this block as this should be a 'consequence' of 'forced_local' modules
|
||||
# special handling for python interpreter for network_os, default to ansible python unless overriden
|
||||
if 'ansible_network_os' in cvars and 'ansible_python_interpreter' not in cvars:
|
||||
# this also avoids 'python discovery'
|
||||
cvars['ansible_python_interpreter'] = sys.executable
|
||||
|
||||
# get handler
|
||||
self._handler = self._get_action_handler(connection=self._connection, templar=templar)
|
||||
|
||||
|
|
Loading…
Reference in a new issue