ovirt_vm: Add option to apply the configuration change on "Next Run" (#48286)

The PR adds new option "next_run" so that user can decide if the
configuration has to be applied on the VM immediately or it has
to be configured on next restart.
pull/48318/head
Nijin Ashok 6 years ago committed by ansibot
parent 54db073817
commit 42c6ed7078

@ -581,6 +581,12 @@ options:
- "If I(true), the VM will migrate even if it is defined as non-migratable." - "If I(true), the VM will migrate even if it is defined as non-migratable."
version_added: "2.8" version_added: "2.8"
type: bool type: bool
next_run:
description:
- "If I(true), the update will not be applied to the VM immediately and will be only applied when virtual machine is restarted."
- NOTE - If there are multiple next run configuration changes on the VM, the first change may get reverted if this option is not passed.
version_added: "2.8"
type: bool
notes: notes:
- If VM is in I(UNASSIGNED) or I(UNKNOWN) state before any operation, the module will fail. - If VM is in I(UNASSIGNED) or I(UNKNOWN) state before any operation, the module will fail.
@ -2049,6 +2055,7 @@ def main():
export_domain=dict(default=None), export_domain=dict(default=None),
export_ova=dict(type='dict'), export_ova=dict(type='dict'),
force_migrate=dict(type='bool'), force_migrate=dict(type='bool'),
next_run=dict(type='bool'),
) )
module = AnsibleModule( module = AnsibleModule(
argument_spec=argument_spec, argument_spec=argument_spec,
@ -2084,6 +2091,7 @@ def main():
ret = vms_module.create( ret = vms_module.create(
entity=vm, entity=vm,
result_state=otypes.VmStatus.DOWN if vm is None else None, result_state=otypes.VmStatus.DOWN if vm is None else None,
update_params={'next_run': module.params['next_run']} if module.params['next_run'] is not None else None,
clone=module.params['clone'], clone=module.params['clone'],
clone_permissions=module.params['clone_permissions'], clone_permissions=module.params['clone_permissions'],
) )

Loading…
Cancel
Save