AnsibleSpaceCheck.yml
· 352 B · YAML
原始文件
---
- name: Check disk usage and fail if any volume is more than 90% full
shell: df --output=pcent,target | grep -v "/var/lib/docker/overlay2" | awk 'NR>1 {gsub("%","",$1); if ($1 > 90) print $2 " is " $1 "% full"}'
register: disk_usage_check
changed_when: false
failed_when: disk_usage_check.stdout != ""
tags: ["check"]
ignore_errors: no
1 | --- |
2 | - name: Check disk usage and fail if any volume is more than 90% full |
3 | shell: df --output=pcent,target | grep -v "/var/lib/docker/overlay2" | awk 'NR>1 {gsub("%","",$1); if ($1 > 90) print $2 " is " $1 "% full"}' |
4 | register: disk_usage_check |
5 | changed_when: false |
6 | failed_when: disk_usage_check.stdout != "" |
7 | tags: ["check"] |
8 | ignore_errors: no |
9 |