You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
589 B
YAML
23 lines
589 B
YAML
---
|
|
|
|
- name: Store facts of hosts
|
|
hosts: all
|
|
gather_facts: yes
|
|
tasks:
|
|
- name: Create directory for facts
|
|
file:
|
|
state: directory
|
|
path: "./facts"
|
|
owner: "{{ local_user }}"
|
|
group: "{{ local_user }}"
|
|
mode: "u=rwx,g=rx,o=rx"
|
|
delegate_to: localhost
|
|
- name: Download facts to file
|
|
copy:
|
|
content: "{{ ansible_facts | to_nice_yaml(indent=2) }}"
|
|
dest: "./facts/{{ ansible_fqdn }}.yml"
|
|
owner: "{{ local_user }}"
|
|
group: "{{ local_user }}"
|
|
mode: "u=rw,g=r,o=r"
|
|
delegate_to: localhost
|