diff --git a/lib/ansible/modules/extras/files/archive.py b/lib/ansible/modules/extras/files/archive.py index 26394b03ad2..96658461e9a 100644 --- a/lib/ansible/modules/extras/files/archive.py +++ b/lib/ansible/modules/extras/files/archive.py @@ -157,7 +157,9 @@ def main(): # Default created file name (for single-file archives) to # . - if not archive and not dest: + if dest: + dest = os.path.expanduser(dest) + elif not archive: dest = '%s.%s' % (expanded_paths[0], compression) # Force archives to specify 'dest'