refactor(global_defaults): add idempotency guards to normalization tasks

This commit is contained in:
2026-02-21 02:39:03 +01:00
parent 86f0284acb
commit 6d1c3577df
2 changed files with 31 additions and 25 deletions

View File

@@ -1,4 +1,7 @@
---
- name: Normalize hypervisor configuration
when: hypervisor_cfg is not defined
block:
- name: Ensure hypervisor input is a dictionary
ansible.builtin.set_fact:
hypervisor: "{{ hypervisor | default({}) }}"
@@ -12,7 +15,7 @@
fail_msg: "hypervisor must be a dictionary and hypervisor.type must be set (e.g. libvirt|proxmox|vmware|xen|none)."
quiet: true
- name: Normalize hypervisor configuration
- name: Merge hypervisor defaults with input
vars:
merged: "{{ hypervisor_defaults | combine(hypervisor, recursive=True) }}"
ansible.builtin.set_fact:

View File

@@ -1,4 +1,7 @@
---
- name: Normalize system and disk configuration
when: system_cfg is not defined
block:
- name: Validate raw system input types
ansible.builtin.include_tasks: _validate_input.yml