moved file around
This commit is contained in:
1 parent
bf94693d29
commit
659d653e90
13 files changed
+580
-1
No files matched your search
@@ -0,0 +1,25 @@
|
||||
---
|
||||
- name: Check disk space
|
||||
hosts: "all"
|
||||
|
||||
tasks:
|
||||
- name: Check disk space available
|
||||
ansible.builtin.shell:
|
||||
cmd: |
|
||||
set -euo pipefail
|
||||
df -Ph / | awk 'NR==2 {print $5}'
|
||||
executable: /bin/bash
|
||||
changed_when: false
|
||||
check_mode: false
|
||||
register: disk_usage
|
||||
|
||||
- name: Diskspace is over 80%
|
||||
ansible.builtin.debug:
|
||||
msg: "Disk is over 80%"
|
||||
when: disk_usage.stdout[:-1]|int>80
|
||||
|
||||
- name: Posting
|
||||
ansible.builtin.command:
|
||||
cmd: 'curl -d "Disk space on {{ inventory_hostname }} is above 80%!" ntfy.ki5bhv.com/server'
|
||||
when: disk_usage.stdout[:-1]|int>80
|
||||
|
||||
Reference in new issue
Block a user