fix networking path (#81295) (#81353)

* now uses class property instead of only relying on network_os variable

---------

Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
(cherry picked from commit 6db006a5fa)
pull/81459/head
Brian Coca 3 years ago committed by GitHub
parent 85a3eb272a
commit 68709ecda2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- core will now also look at the connection plugin to force 'local' interpreter for networking path compatibility as just ansible_network_os could be misleading.

@ -609,9 +609,8 @@ class TaskExecutor:
display.vvvv('local domain socket path is %s' % socket_path, host=self._play_context.remote_addr)
setattr(self._connection, '_socket_path', socket_path)
# 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 overridden
if 'ansible_network_os' in cvars and 'ansible_python_interpreter' not in cvars:
if 'ansible_python_interpreter' not in cvars and 'ansible_network_os' in cvars and getattr(self._connection, '_remote_is_local', False):
# this also avoids 'python discovery'
cvars['ansible_python_interpreter'] = sys.executable

Loading…
Cancel
Save