Add group based on domainname if found
This commit is contained in:
parent
0579a20768
commit
ec4812a157
3 changed files with 7 additions and 5 deletions
|
@ -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 }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue