add ansible_executable inventory var

also handle the overrides appropriately
also new executable to set shell type
This commit is contained in:
Brian Coca 2016-03-11 20:38:38 -05:00
parent 14dfad730e
commit db61e9be0c
6 changed files with 29 additions and 10 deletions

View file

@ -521,7 +521,7 @@ class ActionBase(with_metaclass(ABCMeta, object)):
display.debug("done with _execute_module (%s, %s)" % (module_name, module_args))
return data
def _low_level_execute_command(self, cmd, sudoable=True, in_data=None, executable=C.DEFAULT_EXECUTABLE, encoding_errors='replace'):
def _low_level_execute_command(self, cmd, sudoable=True, in_data=None, executable=None, encoding_errors='replace'):
'''
This is the function which executes the low level shell command, which
may be commands to create/remove directories for temporary files, or to
@ -548,7 +548,9 @@ class ActionBase(with_metaclass(ABCMeta, object)):
display.debug("_low_level_execute_command(): using become for this command")
cmd = self._play_context.make_become_cmd(cmd, executable=executable)
if executable is not None and self._connection.allow_executable:
if self._connection.allow_executable:
if executable is None:
executable = self._play_context.executable
cmd = executable + ' -c ' + pipes.quote(cmd)
display.debug("_low_level_execute_command(): executing: %s" % (cmd,))