diff --git a/lib/ansible/runner/action_plugins/copy.py b/lib/ansible/runner/action_plugins/copy.py index 0ee9b6f3ced..8a489666e44 100644 --- a/lib/ansible/runner/action_plugins/copy.py +++ b/lib/ansible/runner/action_plugins/copy.py @@ -48,9 +48,9 @@ class ActionModule(object): if complex_args: options.update(complex_args) options.update(utils.parse_kv(module_args)) - source = options.get('src', None) + source = os.path.expanduser(options.get('src', None)) content = options.get('content', None) - dest = options.get('dest', None) + dest = os.path.expanduser(options.get('dest', None)) raw = utils.boolean(options.get('raw', 'no')) force = utils.boolean(options.get('force', 'yes')) diff --git a/lib/ansible/runner/action_plugins/unarchive.py b/lib/ansible/runner/action_plugins/unarchive.py index 3e5f98ccae7..55e4519e5c6 100644 --- a/lib/ansible/runner/action_plugins/unarchive.py +++ b/lib/ansible/runner/action_plugins/unarchive.py @@ -46,8 +46,8 @@ class ActionModule(object): if complex_args: options.update(complex_args) options.update(utils.parse_kv(module_args)) - source = options.get('src', None) - dest = options.get('dest', None) + source = os.path.expanduser(options.get('src', None)) + dest = os.path.expanduser(options.get('dest', None)) copy = utils.boolean(options.get('copy', 'yes')) if source is None or dest is None: diff --git a/library/files/copy b/library/files/copy index d961764772a..50ebbb14c04 100644 --- a/library/files/copy +++ b/library/files/copy @@ -113,8 +113,8 @@ def main(): add_file_common_args=True, ) - src = os.path.expanduser(module.params['src']) - dest = os.path.expanduser(module.params['dest']) + src = module.params['src'] + dest = module.params['dest'] backup = module.params['backup'] force = module.params['force'] original_basename = module.params.get('original_basename',None)