From 38a272b004535beeb7d6e3171cbae3c2671fbf55 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 18 Jan 2016 14:32:44 -0500 Subject: [PATCH] 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" --- lib/ansible/parsing/mod_args.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ansible/parsing/mod_args.py b/lib/ansible/parsing/mod_args.py index 86b2d0d996d..fbf5e1c3d61 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: