feat: Create role

This commit is contained in:
2025-09-22 17:51:43 +02:00
committed by pulsar
parent 079950f42f
commit 918c54bbc3
11 changed files with 267 additions and 4 deletions
+12
View File
@@ -0,0 +1,12 @@
#!/bin/bash
# {{ ansible_managed }}
# Get disk usage in percent
pct=$(df --output=pcent $1 | tail -n 1 | tr -d '% ')
# Fail if disk is used more than limit
if [ $pct -gt $2 ]; then
/usr/bin/curl -s --retry 5 -o /dev/null "${3}/fail"
else
/usr/bin/curl -s --retry 5 -o /dev/null "${3}"
fi