diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_disk.py b/lib/ansible/modules/cloud/ovirt/ovirt_disk.py index 9c684f6c166..d10903e8473 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_disk.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_disk.py @@ -165,7 +165,11 @@ options: description: - "If the disk's Wipe After Delete is enabled, then the disk is first wiped." type: bool + activate: + description: + - I(True) if the disk should be activated. version_added: "2.8" + type: bool extends_documentation_fragment: ovirt ''' @@ -547,14 +551,15 @@ class DiskAttachmentsModule(DisksModule): self._module.params.get('interface') ) if self._module.params.get('interface') else None, bootable=self._module.params.get('bootable'), - active=True, + active=self.param('activate'), ) def update_check(self, entity): return ( super(DiskAttachmentsModule, self)._update_check(follow_link(self._connection, entity.disk)) and equal(self._module.params.get('interface'), str(entity.interface)) and - equal(self._module.params.get('bootable'), entity.bootable) + equal(self._module.params.get('bootable'), entity.bootable) and + equal(self.param('activate'), entity.active) ) @@ -600,6 +605,7 @@ def main(): image_provider=dict(default=None), host=dict(default=None), wipe_after_delete=dict(type='bool', default=None), + activate=dict(default=None, type='bool'), ) module = AnsibleModule( argument_spec=argument_spec, diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vm.py b/lib/ansible/modules/cloud/ovirt/ovirt_vm.py index 3d04affacc0..fe722233cb8 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_vm.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_vm.py @@ -1406,7 +1406,7 @@ class VmsModule(BaseModule): disk_service = disks_service.disk_service(da.disk.id) wait( service=disk_service, - condition=lambda disk: disk.status == otypes.DiskStatus.OK, + condition=lambda disk: disk.status == otypes.DiskStatus.OK if disk.storage_type == otypes.DiskStorageType.IMAGE else True, wait=self.param('wait'), timeout=self.param('timeout'), )