diff --git a/lib/ansible/modules/files/unarchive.py b/lib/ansible/modules/files/unarchive.py index 195e8716984..32c1f45229a 100644 --- a/lib/ansible/modules/files/unarchive.py +++ b/lib/ansible/modules/files/unarchive.py @@ -770,7 +770,6 @@ def main(): src = dict(required=True, type='path'), original_basename = dict(required=False, type='str'), # used to handle 'dest is a directory' via template, a slight hack dest = dict(required=True, type='path'), - copy = dict(required=False, default=True, type='bool'), remote_src = dict(required=False, default=False, type='bool'), creates = dict(required=False, type='path'), list_files = dict(required=False, default=False, type='bool'), @@ -780,21 +779,19 @@ def main(): validate_certs = dict(required=False, default=True, type='bool'), ), add_file_common_args = True, - mutually_exclusive = [("copy", "remote_src"),], # check-mode only works for zip files, we cover that later supports_check_mode = True, ) src = module.params['src'] dest = module.params['dest'] - copy = module.params['copy'] remote_src = module.params['remote_src'] file_args = module.load_file_common_arguments(module.params) # did tar file arrive? if not os.path.exists(src): - if not remote_src and copy: + if not remote_src: module.fail_json(msg="Source '%s' failed to transfer" % src) - # If copy=false, and src= contains ://, try and download the file to a temp directory. + # If remote_src=true, and src= contains ://, try and download the file to a temp directory. elif '://' in src: tempdir = os.path.dirname(os.path.realpath(__file__)) package = os.path.join(tempdir, str(src.rsplit('/', 1)[1])) diff --git a/lib/ansible/plugins/action/unarchive.py b/lib/ansible/plugins/action/unarchive.py index 17b9393798a..dbd87853931 100644 --- a/lib/ansible/plugins/action/unarchive.py +++ b/lib/ansible/plugins/action/unarchive.py @@ -53,7 +53,7 @@ class ActionModule(ActionBase): return result # We will take the information from copy and store it in # the remote_src var to use later in this file. - remote_src = not boolean(self._task.args.get('copy')) + self._task.args['remote_src'] = remote_src = not boolean(self._task.args.pop('copy')) if source is None or dest is None: result['failed'] = True @@ -128,7 +128,7 @@ class ActionModule(ActionBase): ) # remove action plugin only key - for key in ('remote_src', 'decrypt'): + for key in ('decrypt',): if key in new_module_args: del new_module_args[key]