feat(global_defaults): add os_family_map and os_family fact for platform config lookups
This commit is contained in:
@@ -9,6 +9,22 @@ os_family_debian:
|
||||
- debian
|
||||
- ubuntu
|
||||
- ubuntu-lts
|
||||
|
||||
# OS → family mapping — aligns with the main project's ansible_os_family pattern.
|
||||
# Enables platform_config dict lookups per role instead of inline when: is_rhel chains.
|
||||
os_family_map:
|
||||
almalinux: RedHat
|
||||
alpine: Alpine
|
||||
archlinux: Archlinux
|
||||
debian: Debian
|
||||
fedora: RedHat
|
||||
opensuse: Suse
|
||||
rhel: RedHat
|
||||
rocky: RedHat
|
||||
ubuntu: Debian
|
||||
ubuntu-lts: Debian
|
||||
void: Void
|
||||
|
||||
os_supported:
|
||||
- almalinux
|
||||
- alpine
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
ansible.builtin.set_fact:
|
||||
is_rhel: "{{ os in os_family_rhel }}"
|
||||
is_debian: "{{ os in os_family_debian }}"
|
||||
os_family: "{{ os_family_map[os] | default('Unknown') }}"
|
||||
|
||||
- name: Normalize OS version for keying
|
||||
when:
|
||||
|
||||
Reference in New Issue
Block a user