ovirt_vm: Fix initialization of cloud init (#47348)

Fixes: https://github.com/ansible/ansible/issues/45900

This PR fixes the case when the cloud_init_persist was used, but we
still sent use_cloud_init=False, which is in oVirt API evaluated as not
to use cloud_init in first VM execution. This patch is changing it to
send just None, instead of False.

Signed-off-by: Ondra Machacek <omachace@redhat.com>
pull/35500/head^2
Ondra Machacek 6 years ago committed by ansibot
parent 4c2efa4b67
commit b177aff41b

@ -2101,8 +2101,8 @@ def main():
),
wait_condition=lambda vm: vm.status == otypes.VmStatus.UP,
# Start action kwargs:
use_cloud_init=not module.params.get('cloud_init_persist') and module.params.get('cloud_init') is not None,
use_sysprep=not module.params.get('cloud_init_persist') and module.params.get('sysprep') is not None,
use_cloud_init=True if not module.params.get('cloud_init_persist') and module.params.get('cloud_init') is not None else None,
use_sysprep=True if not module.params.get('cloud_init_persist') and module.params.get('sysprep') is not None else None,
vm=otypes.Vm(
placement_policy=otypes.VmPlacementPolicy(
hosts=[otypes.Host(name=module.params['host'])]

Loading…
Cancel
Save