From 6d841d120eb3d73d539c11859164316d75663546 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Wed, 12 Mar 2014 11:57:28 -0400 Subject: [PATCH] Don't process shell commands as arrays. --- lib/ansible/module_utils/basic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 09bdde6cd30..2d459873146 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1019,7 +1019,8 @@ class AnsibleModule(object): self.fail_json(rc=257, cmd=args, msg=msg) # expand things like $HOME and ~ - args = [ os.path.expandvars(os.path.expanduser(x)) for x in args ] + if not shell: + args = [ os.path.expandvars(os.path.expanduser(x)) for x in args ] rc = 0 msg = None