Files

21 lines
541 B
YAML
Raw Permalink Normal View History

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"
register: cpu_fact
2024-10-26 16:23:45 +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
when: cpu_fact is changed