added diskspace
This commit is contained in:
@@ -3,12 +3,4 @@
|
|||||||
- name: Update apt packages
|
- name: Update apt packages
|
||||||
apt:
|
apt:
|
||||||
upgrade: yes
|
upgrade: yes
|
||||||
update_cache: 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
15
diskspace.yml
Normal 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 }}
|
||||||
Reference in New Issue
Block a user