Add group based on domainname if found

This commit is contained in:
Timo Makinen 2025-01-15 20:04:17 +00:00
parent 0579a20768
commit ec4812a157
3 changed files with 7 additions and 5 deletions

View file

@ -1,4 +1,10 @@
---
- name: Group by domainname
ansible.builtin.group_by:
key: "{{ inventory_hostname.split('.')[1] }}"
changed_when: false
when: inventory_hostname | split('.') | length == 4
- name: Setup ansible custom facts
ansible.builtin.file:
dest: "{{ item }}"