diff options
author | Matt Clay <matt@mystile.com> | 2016-11-22 16:50:08 -0800 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2016-12-06 06:55:15 -0800 |
commit | acad2ba24691d9a145c912dc97a54cd8c2b873eb (patch) | |
tree | e8e0d2ef811dba630b92caa104da58e8cf13be7e | |
parent | 47cd4867a1840a3d219fe248d4e813ee2bc83abc (diff) | |
download | ansible-acad2ba24691d9a145c912dc97a54cd8c2b873eb.tar.gz |
Support script interpreters for async_wrapper. (#18592)
(cherry picked from commit d61b2ed0a3f7c8647fbf0b912c66711e95fc9127)
-rw-r--r-- | lib/ansible/plugins/action/async.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/ansible/plugins/action/async.py b/lib/ansible/plugins/action/async.py index 6c348c7d9f..fc564c1283 100644 --- a/lib/ansible/plugins/action/async.py +++ b/lib/ansible/plugins/action/async.py @@ -91,7 +91,15 @@ class ActionModule(ActionBase): async_limit = self._task.async async_jid = str(random.randint(0, 999999999999)) - async_cmd = [env_string, remote_async_module_path, async_jid, async_limit, remote_module_path] + # call the interpreter for async_wrapper directly + # this permits use of a script for an interpreter on non-Linux platforms + # TODO: re-implement async_wrapper as a regular module to avoid this special case + interpreter = shebang.replace('#!', '').strip() + async_cmd = [interpreter, remote_async_module_path, async_jid, async_limit, remote_module_path] + + if env_string: + async_cmd.insert(0, env_string) + if argsfile: async_cmd.append(argsfile) else: |