diff options
author | James Cammarata <jimi@sngx.net> | 2016-01-18 14:32:44 -0500 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2016-01-18 14:32:44 -0500 |
commit | 46e515131e8a25943efe65ffe32c45f4e1246a9b (patch) | |
tree | cb018887271c6ba3894c443bc0680e346b1d4b23 | |
parent | b769426c8f7c022c9c679406c2ec3bb1e91273af (diff) | |
download | ansible-46e515131e8a25943efe65ffe32c45f4e1246a9b.tar.gz |
Allow module args as k=v pairs when using the module: option with local_action
This task format is valid in 1.x, but was broken in 2.x:
- local_action:
module: shell echo "hello world"
-rw-r--r-- | lib/ansible/parsing/mod_args.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ansible/parsing/mod_args.py b/lib/ansible/parsing/mod_args.py index 86b2d0d996..fbf5e1c3d6 100644 --- a/lib/ansible/parsing/mod_args.py +++ b/lib/ansible/parsing/mod_args.py @@ -222,18 +222,21 @@ class ModuleArgsParser: action = None args = None + actions_allowing_raw = ('command', 'shell', 'script', 'raw') if isinstance(thing, dict): # form is like: copy: { src: 'a', dest: 'b' } ... common for structured (aka "complex") args thing = thing.copy() if 'module' in thing: - action = thing['module'] + action, module_args = self._split_module_string(thing['module']) args = thing.copy() + check_raw = action in actions_allowing_raw + args.update(parse_kv(module_args, check_raw=check_raw)) del args['module'] elif isinstance(thing, string_types): # form is like: copy: src=a dest=b ... common shorthand throughout ansible (action, args) = self._split_module_string(thing) - check_raw = action in ('command', 'shell', 'script', 'raw') + check_raw = action in actions_allowing_raw args = parse_kv(args, check_raw=check_raw) else: |