ansitest/Demo_df-rootusage.yml
2020-05-28 17:58:34 -05:00

12 lines
349 B
YAML

---
- hosts: all
gather_facts: no
tasks:
- name: ZFS-aware Root FS usage
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}'
register: dfroot
- debug:
msg: "System {{ inventory_hostname }}'s root FS utilization is {{ dfroot.stdout }}"