21 lines
541 B
YAML
21 lines
541 B
YAML
---
|
|
- name: Create directory for ansible custom facts
|
|
ansible.builtin.file:
|
|
state: directory
|
|
recurse: true
|
|
path: /etc/ansible/facts.d
|
|
|
|
- name: Install custom CPU fact
|
|
ansible.builtin.template:
|
|
src: etc/ansible/facts.d/cpu_info.fact
|
|
dest: /etc/ansible/facts.d
|
|
owner: "{{ ansible_user_id }}"
|
|
group: "{{ ansible_user_id }}"
|
|
mode: "0777"
|
|
register: cpu_fact
|
|
|
|
- name: Re-read facts if custom fact was installed this run # noqa: no-handler
|
|
ansible.builtin.setup:
|
|
filter: ansible_local
|
|
when: cpu_fact is changed
|