Fix vm creation when no rhel_iso for vmware

This commit is contained in:
Sandwich 2025-02-20 16:00:39 +01:00
parent c96fcf5e96
commit 60c552be45

@ -22,19 +22,26 @@
num_cpus: "{{ vm_cpus }}"
boot_firmware: efi
secure_boot: false
cdrom:
- controller_number: 0
unit_number: 0
controller_type: sata
state: present
type: iso
iso_path: "{{ boot_iso }}"
- controller_number: 0
unit_number: 1
controller_type: sata
state: present
type: iso
iso_path: "{{ rhel_iso | default(omit) }}"
cdrom: >-
{{
[ {
"controller_number": 0,
"unit_number": 0,
"controller_type": "sata",
"state": "present",
"type": "iso",
"iso_path": boot_iso
} ]
+
( [ {
"controller_number": 0,
"unit_number": 1,
"controller_type": "sata",
"state": "present",
"type": "iso",
"iso_path": rhel_iso
} ] if rhel_iso is defined and rhel_iso|length > 0 else [] )
}}
networks:
- name: "{{ vm_nif }}"
type: dhcp