issue #291: restore behaviour of invoking binaries via /bin/sh

This ensures failed task output matches vanilla Ansible exactly (as it
did before starting #291).
This commit is contained in:
David Wilson 2018-07-23 21:41:34 -07:00
parent c5ea7c45a1
commit de0d526487
1 changed files with 11 additions and 1 deletions

View File

@ -398,7 +398,17 @@ class ProgramRunner(Runner):
"""
Return the final argument vector used to execute the program.
"""
return [self.program_fp.name] + self._get_program_args()
return [
self.args['_ansible_shell_executable'],
'-c',
self._get_shell_fragment(),
]
def _get_shell_fragment(self):
return "%s %s" % (
shlex_quote(self.program_fp.name),
' '.join(map(shlex_quote, self._get_program_args())),
)
def _run(self):
try: