Files
meshbook/examples/linux/disk_info.yaml

8 lines
385 B
YAML

---
name: Use DF to get drive information in JSON.
group: Systemec Development
target_os: "Linux"
tasks:
- name: Get disk-info with df returning JSON.
command: >
df -Th -x overlay -x tmpfs -x devtmpfs | awk 'NR>1 {printf "%s{\"size\":\"%s\",\"used\":\"%s\",\"available\":\"%s\",\"mount_point\":\"%s\",\"type\":\"%s\"}", (NR==2?"[":","), $3, $4, $5, $7, $2} END {print "]"}'