diff --git a/lib/ansible/module_utils/kubevirt.py b/lib/ansible/module_utils/kubevirt.py index 3c468b93f4d..5bbcacce492 100644 --- a/lib/ansible/module_utils/kubevirt.py +++ b/lib/ansible/module_utils/kubevirt.py @@ -255,12 +255,14 @@ class KubeVirtRawModule(KubernetesRawModule): if machine_type: template_spec['domain']['machine']['type'] = machine_type - # Define cloud init disk if defined: - self._define_cloud_init(cloud_init_nocloud, template_spec) - # Define disks self._define_disks(disks, template_spec) + # Define cloud init disk if defined: + # Note, that this must be called after _define_disks, so the cloud_init + # is not first in order and it's not used as boot disk: + self._define_cloud_init(cloud_init_nocloud, template_spec) + # Define interfaces: self._define_interfaces(interfaces, template_spec) diff --git a/lib/ansible/modules/cloud/kubevirt/kubevirt_vm.py b/lib/ansible/modules/cloud/kubevirt/kubevirt_vm.py index f486c9b116b..6fdbfd64563 100644 --- a/lib/ansible/modules/cloud/kubevirt/kubevirt_vm.py +++ b/lib/ansible/modules/cloud/kubevirt/kubevirt_vm.py @@ -159,8 +159,8 @@ EXAMPLES = ''' namespace: vms memory: 1024M cloud_init_nocloud: - #cloud-config userData: |- + #cloud-config password: fedora chpasswd: { expire: False } disks: