ansible-dhcpd/tasks/dist_vars.yml
2024-01-13 17:08:19 +01:00

19 lines
501 B
YAML

---
- name: Include distribution specific variables
ansible.builtin.include_vars:
file: "{{ item }}"
name: _os_specific
with_first_found:
- "{{ ansible_distribution_release }}.yml"
- "{{ ansible_distribution }}.yml"
- "{{ ansible_os_family }}.yml"
- "default.yml"
- name: Set OS specific vars if undefined
ansible.builtin.set_fact: {
"{{ item.key }}":
"{{ hostvars[inventory_hostname][item.key] | default(item.value) }}"
}
with_dict: "{{ _os_specific }}"