diff --git a/aptupdates.yml b/aptupdates.yml index 9364b55..185673f 100644 --- a/aptupdates.yml +++ b/aptupdates.yml @@ -3,12 +3,4 @@ - name: Update apt packages 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 \ No newline at end of file + update_cache: yes \ No newline at end of file diff --git a/diskspace.yml b/diskspace.yml new file mode 100644 index 0000000..fc99962 --- /dev/null +++ b/diskspace.yml @@ -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 }} \ No newline at end of file