Fix activate of the disks in ovirt_vm and ovirt_disk modules (#49762)
* ovirt_disk: Add activate parameter * ovirt_vm: Fix waiting on lun disks Signed-off-by: Ondra Machacek <omachace@redhat.com>
This commit is contained in:
parent
f431e5b0e2
commit
e733d6e557
2 changed files with 9 additions and 3 deletions
|
@ -165,7 +165,11 @@ options:
|
||||||
description:
|
description:
|
||||||
- "If the disk's Wipe After Delete is enabled, then the disk is first wiped."
|
- "If the disk's Wipe After Delete is enabled, then the disk is first wiped."
|
||||||
type: bool
|
type: bool
|
||||||
|
activate:
|
||||||
|
description:
|
||||||
|
- I(True) if the disk should be activated.
|
||||||
version_added: "2.8"
|
version_added: "2.8"
|
||||||
|
type: bool
|
||||||
extends_documentation_fragment: ovirt
|
extends_documentation_fragment: ovirt
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
@ -547,14 +551,15 @@ class DiskAttachmentsModule(DisksModule):
|
||||||
self._module.params.get('interface')
|
self._module.params.get('interface')
|
||||||
) if self._module.params.get('interface') else None,
|
) if self._module.params.get('interface') else None,
|
||||||
bootable=self._module.params.get('bootable'),
|
bootable=self._module.params.get('bootable'),
|
||||||
active=True,
|
active=self.param('activate'),
|
||||||
)
|
)
|
||||||
|
|
||||||
def update_check(self, entity):
|
def update_check(self, entity):
|
||||||
return (
|
return (
|
||||||
super(DiskAttachmentsModule, self)._update_check(follow_link(self._connection, entity.disk)) and
|
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('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),
|
image_provider=dict(default=None),
|
||||||
host=dict(default=None),
|
host=dict(default=None),
|
||||||
wipe_after_delete=dict(type='bool', default=None),
|
wipe_after_delete=dict(type='bool', default=None),
|
||||||
|
activate=dict(default=None, type='bool'),
|
||||||
)
|
)
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=argument_spec,
|
argument_spec=argument_spec,
|
||||||
|
|
|
@ -1406,7 +1406,7 @@ class VmsModule(BaseModule):
|
||||||
disk_service = disks_service.disk_service(da.disk.id)
|
disk_service = disks_service.disk_service(da.disk.id)
|
||||||
wait(
|
wait(
|
||||||
service=disk_service,
|
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'),
|
wait=self.param('wait'),
|
||||||
timeout=self.param('timeout'),
|
timeout=self.param('timeout'),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue