jeff revised this gist . Go to revision
1 file changed, 8 insertions
AnsibleSpaceCheck.yml(file created)
@@ -0,0 +1,8 @@ | |||
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 |
Newer
Older