Files
configpolicy/dyngroups.yml
Dustin C. Hatch 4a1e961d57 dyngroups: Also group by distribution and version
Adding dynamic groups for speciffic Linux distributions and versions
thereof so we can apply settings based on those properties.
2022-12-19 10:20:09 -06:00

21 lines
601 B
YAML

- hosts: all
gather_facts: true
tasks:
- name: group hosts by distribution
group_by:
key: '{{ ansible_distribution }}'
changed_when: false
- name: group hosts by distribution+version
group_by:
key: '{{ ansible_distribution }}{{ ansible_distribution_major_version }}'
changed_when: false
- name: group hosts by os family
group_by:
key: '{{ ansible_os_family }}'
changed_when: false
- name: group hosts by virtualization
group_by:
key: >-
{{ ansible_virtualization_type }}-{{ ansible_virtualization_role }}
changed_when: false