diff --git a/lib/ansible/modules/cloud/google/gcp_storage_object.py b/lib/ansible/modules/cloud/google/gcp_storage_object.py index fc3c304733eebe..f57a08d9acb749 100644 --- a/lib/ansible/modules/cloud/google/gcp_storage_object.py +++ b/lib/ansible/modules/cloud/google/gcp_storage_object.py @@ -164,7 +164,7 @@ def main(): module.fail_json(msg="File does not exist on disk") # Check if we'll be overwriting files. - if not module.params['overwrite']: + if remote_object and not module.params['overwrite']: remote_object['changed'] = False if module.params['action'] == 'download' and local_file_exists: # If files differ, throw an error