Updated folder structure

This commit is contained in:
2026-01-31 21:06:50 +01:00
parent d05a5d8c98
commit 99b976d795
2 changed files with 4 additions and 3 deletions

19
playbooks/diskspace.yml Normal file
View File

@@ -0,0 +1,19 @@
---
- hosts: all
tasks:
- name: Get disk usage
shell: df -h / | awk 'NR==2 {print $5}'
register: disk_usage
- name: Print disk usage
ansible.builtin.debug:
msg: "{{ disk_usage.stdout }}"
- name: Send notification
community.general.pushover:
title: 'Disk Space Warning!'
msg: 'Disk usage from {{inventory_hostname}} is at {{ disk_usage.stdout }}'
app_token: '{{ app_token }}'
user_key: '{{ user_key }}'
delegate_to: localhost
when: disk_usage.stdout[:-1]|int > disk_threshold|int