diff options
author | Michael DeHaan <michael@ansibleworks.com> | 2014-03-12 10:10:45 -0400 |
---|---|---|
committer | Michael DeHaan <michael.dehaan@gmail.com> | 2014-03-12 16:03:48 -0400 |
commit | dbfcf0325e5e3fc0789d36b7054732dd5e4021ba (patch) | |
tree | 587495f210dccfa91e6b061fad8125dc5fd8f306 /lib/ansible | |
parent | 72c7841c572bba32b2e96655ae30c2d0577fab46 (diff) | |
download | ansible-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.py | 3 |
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 |