fix(virtualization): create vmware target folder before vm deploy

This commit is contained in:
2026-06-04 18:17:50 +02:00
parent 7f12a0f3d8
commit 4fff9f8d80

View File

@@ -17,8 +17,15 @@
community.vmware.vmware_guest: "{{ _vmware_auth }}"
community.vmware.vmware_guest_tpm: "{{ _vmware_auth }}"
vmware.vmware.vm_powerstate: "{{ _vmware_auth }}"
vmware.vmware.folder: "{{ _vmware_auth }}"
block:
# community.vmware: full-featured guest management
# vmware_guest places into folder but will not create it; ensure it exists first.
- name: Ensure target folder exists
when: system_cfg.path | string | length > 0
vmware.vmware.folder:
absolute_path: "/{{ hypervisor_cfg.datacenter }}/vm/{{ system_cfg.path | regex_replace('^/+', '') }}"
state: present
- name: Create VM in vCenter
vars:
virtualization_vmware_networks: >-
@@ -98,7 +105,6 @@
fail_msg: "Failed to add vTPM2 to VM '{{ hostname }}'. LUKS with TPM2 requires a virtual TPM device."
quiet: true
# vmware.vmware: modern collection for power operations
- name: Start VM in vCenter
when: virtualization_tpm2_enabled | bool
vmware.vmware.vm_powerstate: