diff --git a/lib/ansible/modules/cloud/openstack/os_volume.py b/lib/ansible/modules/cloud/openstack/os_volume.py index 17d820aa20..96476b197d 100644 --- a/lib/ansible/modules/cloud/openstack/os_volume.py +++ b/lib/ansible/modules/cloud/openstack/os_volume.py @@ -131,14 +131,16 @@ def _present_volume(module, cloud): def _absent_volume(module, cloud): - try: - cloud.delete_volume( - name_or_id=module.params['display_name'], - wait=module.params['wait'], - timeout=module.params['timeout']) - except shade.OpenStackCloudTimeout: - module.exit_json(changed=False) - module.exit_json(changed=True) + changed = False + if cloud.volume_exists(module.params['display_name']): + try: + changed = cloud.delete_volume(name_or_id=module.params['display_name'], + wait=module.params['wait'], + timeout=module.params['timeout']) + except shade.OpenStackCloudTimeout: + module.exit_json(changed=changed) + + module.exit_json(changed=changed) def main():