summaryrefslogtreecommitdiff
path: root/lib/ansible
diff options
context:
space:
mode:
authorMichael DeHaan <michael@ansibleworks.com>2014-03-12 10:10:45 -0400
committerMichael DeHaan <michael.dehaan@gmail.com>2014-03-12 16:03:48 -0400
commitdbfcf0325e5e3fc0789d36b7054732dd5e4021ba (patch)
tree587495f210dccfa91e6b061fad8125dc5fd8f306 /lib/ansible
parent72c7841c572bba32b2e96655ae30c2d0577fab46 (diff)
downloadansible-dbfcf0325e5e3fc0789d36b7054732dd5e4021ba.tar.gz
Expand environment variables and tildes passed to commands generically across the board.
Diffstat (limited to 'lib/ansible')
-rw-r--r--lib/ansible/module_utils/basic.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py
index d2e08f713d..1aa63fee0f 100644
--- a/lib/ansible/module_utils/basic.py
+++ b/lib/ansible/module_utils/basic.py
@@ -1017,6 +1017,9 @@ class AnsibleModule(object):
msg = "Argument 'args' to run_command must be list or string"
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 ]
+
rc = 0
msg = None
st_in = None