Add healthcheck pings to opentofu and add systemd cleanup to healthcheck

This commit is contained in:
Tobias Reisinger 2024-10-06 20:47:59 +02:00
parent 2ad3cce749
commit a15e70d73d
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
7 changed files with 60 additions and 11 deletions
roles/healthcheck/files/data

View file

@ -2,7 +2,6 @@
cd /opt/ || exit
hc_url="https://hc-ping.com/$HTTP_HC_UID"
services_down=""
error=""
@ -46,8 +45,8 @@ check_url "www.reitanlage-oranienburg.de"
if [ "$error" = "" ]
then
curl_hc "$hc_url" >/dev/null
curl_hc "$HTTP_HC_URL" >/dev/null
echo "ALL GOOD"
else
curl_hc --data-raw "$services_down$error" "$hc_url/fail" >/dev/null
curl_hc --data-raw "$services_down$error" "$HTTP_HC_URL/fail" >/dev/null
fi