feat(vmware): add hypervisor.node as unified placement field (replaces host)

This commit is contained in:
2026-03-11 04:05:36 +01:00
committed by MORAWSKI Norbert
parent 13faf33296
commit 44aa6ac369
5 changed files with 24 additions and 6 deletions

View File

@@ -32,7 +32,7 @@
api_host: "{{ hypervisor_cfg.url }}"
api_user: "{{ hypervisor_cfg.username }}"
api_password: "{{ hypervisor_cfg.password }}"
node: "{{ hypervisor_cfg.host }}"
node: "{{ hypervisor_cfg.node }}"
no_log: true
- name: Normalize system inputs

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"