Skip to content

Commit

Permalink
ovirt_vm: Fix initialization of cloud init
Browse files Browse the repository at this point in the history
Fixes: ansible#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>
  • Loading branch information
machacekondra committed Oct 23, 2018
1 parent 7f4945a commit bfe3300
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- ovirt_vm - Fix initialization of cloud init (https://github.com/ansible/ansible/pull/47354).
4 changes: 2 additions & 2 deletions lib/ansible/modules/cloud/ovirt/ovirt_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2034,8 +2034,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'])]
Expand Down

0 comments on commit bfe3300

Please sign in to comment.