feat(vmware): add VMware hypervisor support (node field, connection vars, validation)

This commit is contained in:
2026-03-12 07:43:34 +01:00
parent 13faf33296
commit 79227b4391
9 changed files with 54 additions and 13 deletions

View File

@@ -166,6 +166,23 @@
label: "hypervisor.{{ item }}"
no_log: true
- name: Validate VMware placement (cluster or node required, mutually exclusive)
when:
- system_cfg.type == "virtual"
- hypervisor_type == "vmware"
ansible.builtin.assert:
that:
- >-
(hypervisor_cfg.cluster | default('') | string | length > 0)
or (hypervisor_cfg.node | default('') | string | length > 0)
- >-
(hypervisor_cfg.cluster | default('') | string | length == 0)
or (hypervisor_cfg.node | default('') | string | length == 0)
fail_msg: >-
VMware requires either hypervisor.cluster or hypervisor.node (mutually exclusive).
cluster targets a vSphere cluster; node targets a specific ESXi host.
quiet: true
- name: Validate hypervisor-specific required system fields
when:
- system_cfg.type == "virtual"
@@ -293,8 +310,8 @@
system_disk_mounts: >-
{{
(system_cfg.disks | default([]))
| map(attribute='mount')
| map(attribute='path')
| map(attribute='mount', default={})
| map(attribute='path', default='')
| map('string')
| map('trim')
| reject('equalto', '')