Added playbook to store facts of hosts
parent
e011804360
commit
dae5abed61
@ -0,0 +1,22 @@
|
||||
---
|
||||
|
||||
- name: Store facts of hosts
|
||||
hosts: all
|
||||
gather_facts: yes
|
||||
tasks:
|
||||
- name: Create directory for facts
|
||||
file:
|
||||
state: directory
|
||||
path: "./facts"
|
||||
owner: zocker
|
||||
group: zocker
|
||||
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: zocker
|
||||
group: zocker
|
||||
mode: "u=rw,g=r,o=r"
|
||||
delegate_to: localhost
|
Loading…
Reference in New Issue