2024-10-26 16:23:45 +02:00
|
|
|
---
|
|
|
|
|
- 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"
|
2025-09-01 16:30:14 +02:00
|
|
|
register: cpu_fact
|
2024-10-26 16:23:45 +02:00
|
|
|
|
2025-09-01 16:30:14 +02:00
|
|
|
- name: Re-read facts if custom fact was installed this run # noqa: no-handler
|
2024-10-26 16:23:45 +02:00
|
|
|
ansible.builtin.setup:
|
|
|
|
|
filter: ansible_local
|
2025-09-01 16:30:14 +02:00
|
|
|
when: cpu_fact is changed
|