Created
October 13, 2021 09:08
-
-
Save VerosK/28faad32d177a49ea946411c3bb81ed4 to your computer and use it in GitHub Desktop.
Get disk usage with Ansible
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Show FS info | |
hosts: all | |
gather_facts: yes | |
tasks: | |
- setup: | |
- name: Create summary report | |
template: | |
src: 'summary.txt.j2' | |
dest: reports/summary.txt | |
backup: yes | |
become: no | |
delegate_to: localhost | |
run_once: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for host in hostvars %} | |
{% for mount in hostvars[host].ansible_mounts %} | |
{{ host }},{{ hostvars[host].ansible_fqdn }},{{ mount.mount }},{{ mount.size_available }},{{ mount.size_total }} | |
{% endfor %} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment