ansitest/Demo_df-rootusage.yml

12 lines
350 B
YAML
Raw Normal View History

2020-05-28 17:05:40 -05:00
---
- hosts: all
gather_facts: no
tasks:
2020-05-28 18:01:06 -05:00
- name: ZFSaware 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}')
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 }}"