Files
Ansible-Bootstrap/roles/global_defaults/tasks/hypervisor.yml
Sandwich 2a288fa840 refactor(standardize): remove dead code, fix inconsistencies, update docs
- Remove unused sudo_lecture.txt.j2 template (never referenced)
- Add vars_proxmox.yml and .sisyphus/ to .gitignore
- Remove redundant inner when conditions in cleanup/vmware.yml
- Standardize bootstrap_var_key usage in alpine, opensuse, void tasks
- Normalize sysctl key=value formatting (remove inconsistent spaces)
- Add vars_baremetal_example.yml to README examples list
- Remove unnecessary changed_when on set_fact in hypervisor.yml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 23:21:51 +01:00

21 lines
698 B
YAML

---
- name: Ensure hypervisor input is a dictionary
ansible.builtin.set_fact:
hypervisor: "{{ hypervisor | default({}) }}"
- name: Validate hypervisor input
ansible.builtin.assert:
that:
- hypervisor is mapping
- hypervisor.type is defined
- hypervisor.type | string | length > 0
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
vars:
merged: "{{ hypervisor_defaults | combine(hypervisor, recursive=True) }}"
ansible.builtin.set_fact:
hypervisor_cfg: "{{ merged }}"
hypervisor_type: "{{ merged.type | string | lower }}"