added diskspace

This commit is contained in:
2023-07-22 21:29:04 +02:00
parent a273d66b0b
commit f2529fadfc
2 changed files with 16 additions and 9 deletions

View File

@@ -4,11 +4,3 @@
apt:
upgrade: yes
update_cache: yes
- name: Send notifications
community.general.pushover:
title: 'APT Updates'
msg: '{{ testvar }} has been lost somewhere'
app_token: '{{ app_token }}'
user_key: '{{ user_key }}'
delegate_to: localhost

15
diskspace.yml Normal file
View File

@@ -0,0 +1,15 @@
- hosts: all
tasks:
- name: Get disk usage
command: df -h / | awk 'NR==2 {print $5}'
register: disk_usage
- name: Send notification
community.general.pushover:
title: 'Disk Space Warning'
msg: 'Disk usage is {{ disk_usage.stdout }}!'
app_token: '{{ app_token }}'
user_key: '{{ user_key }}'
delegate_to: localhost
when: disk_usage.stdout > {{ disk_threshold }}