base: Add ansible_server fact
This commit is contained in:
parent
20f1af0ee4
commit
0530194ac0
1 changed files with 14 additions and 0 deletions
|
@ -5,6 +5,20 @@
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when: inventory_hostname | split('.') | length == 4
|
when: inventory_hostname | split('.') | length == 4
|
||||||
|
|
||||||
|
- name: Get ansible server name
|
||||||
|
ansible.builtin.command:
|
||||||
|
argv:
|
||||||
|
- hostname
|
||||||
|
- -f
|
||||||
|
changed_when: false
|
||||||
|
delegate_to: localhost
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- name: Store ansible server name
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
ansible_server: "{{ result.stdout }}"
|
||||||
|
cacheable: false
|
||||||
|
|
||||||
- name: Setup ansible custom facts
|
- name: Setup ansible custom facts
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
dest: "{{ item }}"
|
dest: "{{ item }}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue