ansitest/Demo_df-rootusage.yml

12 lines
349 B
YAML
Raw Normal View History

2020-05-28 17:05:40 -05:00
---
- hosts: all
gather_facts: no
tasks:
2020-05-28 17:52:23 -05:00
- name: ZFS-aware Root FS usage
2020-05-28 17:58:34 -05:00
shell: [ $(df -hT / |grep -c zfs) -gt 0 ] && zpool list rpool |grep -v ALLOC |awk '{print $3}' || df -h / |grep -v Use |awk '{print $5}'
2020-05-28 17:05:40 -05:00
register: dfroot
- debug:
2020-05-28 17:52:23 -05:00
msg: "System {{ inventory_hostname }}'s root FS utilization is {{ dfroot.stdout }}"