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