custom-facts: init
This commit is contained in:
parent
a8f0a4c048
commit
23cc76ac06
7 changed files with 45 additions and 0 deletions
24
roles/custom-facts/tasks/main.yml
Normal file
24
roles/custom-facts/tasks/main.yml
Normal file
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
# tasks file for 'custom-facts' role
|
||||
- name: 'Ensure custom facts directory exists' # hosts without Ansible installed benefit from this
|
||||
ansible.builtin.file:
|
||||
state: directory
|
||||
path: /etc/ansible/facts.d
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
become: true
|
||||
|
||||
- name: Copy custom facts
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.name }}"
|
||||
dest: /etc/ansible/facts.d/
|
||||
mode: "{{ item.mode }}" # facts may be plainly-readable JSON/INI files, or executables that return JSON
|
||||
owner: root
|
||||
group: root
|
||||
notify: regather_facts
|
||||
loop: "{{ custom_facts }}"
|
||||
become: true
|
||||
|
||||
- name: Flush pending handlers
|
||||
ansible.builtin.meta: flush_handlers
|
Loading…
Add table
Add a link
Reference in a new issue