From 5f0a348447809b71254d21a652dd39f7d0e995f0 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Fri, 8 Jan 2016 11:37:28 -0600 Subject: [PATCH] Restore ability for a module to specify WANT_JSON --- lib/ansible/plugins/action/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index 3f4fff588e..6c65716bbf 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -397,7 +397,7 @@ class ActionBase(with_metaclass(ABCMeta, object)): if tmp: remote_module_filename = self._connection._shell.get_remote_filename(module_name) remote_module_path = self._connection._shell.join_path(tmp, remote_module_filename) - if module_style == 'old': + if module_style in ['old', 'non_native_want_json']: # we'll also need a temp file to hold our module arguments args_file_path = self._connection._shell.join_path(tmp, 'args') @@ -411,6 +411,8 @@ class ActionBase(with_metaclass(ABCMeta, object)): for k,v in iteritems(module_args): args_data += '%s="%s" ' % (k, pipes.quote(text_type(v))) self._transfer_data(args_file_path, args_data) + elif module_style == 'non_native_want_json': + self._transfer_data(args_file_path, json.dumps(module_args)) display.debug("done transferring module to remote") environment_string = self._compute_environment_string()