From 6969b5ac8b789d81159234614b708ee86190bf76 Mon Sep 17 00:00:00 2001 From: Chris Church Date: Sun, 2 Aug 2015 11:57:32 -0400 Subject: [PATCH] Make sure raw doesn't eat key=value arguments. --- lib/ansible/parsing/mod_args.py | 4 ++-- test/integration/roles/test_win_raw/tasks/main.yml | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/ansible/parsing/mod_args.py b/lib/ansible/parsing/mod_args.py index d75ed9416b..8a084587d0 100644 --- a/lib/ansible/parsing/mod_args.py +++ b/lib/ansible/parsing/mod_args.py @@ -181,7 +181,7 @@ class ModuleArgsParser: args = thing elif isinstance(thing, string_types): # form is like: local_action: copy src=a dest=b ... pretty common - check_raw = action in ('command', 'shell', 'script') + check_raw = action in ('command', 'shell', 'script', 'raw') args = parse_kv(thing, check_raw=check_raw) elif thing is None: # this can happen with modules which take no params, like ping: @@ -218,7 +218,7 @@ class ModuleArgsParser: 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') + check_raw = action in ('command', 'shell', 'script', 'raw') args = parse_kv(args, check_raw=check_raw) else: diff --git a/test/integration/roles/test_win_raw/tasks/main.yml b/test/integration/roles/test_win_raw/tasks/main.yml index dffc04ab34..8a5412c381 100644 --- a/test/integration/roles/test_win_raw/tasks/main.yml +++ b/test/integration/roles/test_win_raw/tasks/main.yml @@ -83,3 +83,12 @@ - "not sleep_command.stderr" - "not sleep_command|failed" - "not sleep_command|changed" + +- name: run a raw command with key=value arguments + raw: echo wwe=raw + register: raw_result + +- name: make sure raw is really raw and not removing key=value arguments + assert: + that: + - "raw_result.stdout_lines[0] == 'wwe=raw'"