From 197bed6fd8be7626e480fff32fbb41375ebc1b55 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 2 Feb 2016 13:13:02 -0500 Subject: [PATCH] make executable setting connection dependant winrm shoudl not use executable, rest should? fixes #14233 --- lib/ansible/plugins/action/__init__.py | 2 +- lib/ansible/plugins/connection/__init__.py | 1 + lib/ansible/plugins/connection/winrm.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index 62a2e7806f..d201850d64 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -505,7 +505,7 @@ class ActionBase(with_metaclass(ABCMeta, object)): replacement strategy (python3 could use surrogateescape) ''' - if executable is not None: + if executable is not None and self._connection.allow_executable: cmd = executable + ' -c ' + pipes.quote(cmd) display.debug("_low_level_execute_command(): starting") diff --git a/lib/ansible/plugins/connection/__init__.py b/lib/ansible/plugins/connection/__init__.py index bea8e5b426..f101c07d9f 100644 --- a/lib/ansible/plugins/connection/__init__.py +++ b/lib/ansible/plugins/connection/__init__.py @@ -60,6 +60,7 @@ class ConnectionBase(with_metaclass(ABCMeta, object)): # as discovered by the specified file extension. An empty string as the # language means any language. module_implementation_preferences = ('',) + allow_executable = True def __init__(self, play_context, new_stdin, *args, **kwargs): # All these hasattrs allow subclasses to override these parameters diff --git a/lib/ansible/plugins/connection/winrm.py b/lib/ansible/plugins/connection/winrm.py index c291e21782..5d731c31dd 100644 --- a/lib/ansible/plugins/connection/winrm.py +++ b/lib/ansible/plugins/connection/winrm.py @@ -63,6 +63,7 @@ class Connection(ConnectionBase): module_implementation_preferences = ('.ps1', '') become_methods = [] + allow_executable = False def __init__(self, *args, **kwargs):