diff --git a/provision-contest/ansible/roles/keepalived/files/alerting/bin/alerting.sh.template b/provision-contest/ansible/roles/keepalived/files/alerting/bin/alerting.sh.template index a44e77a1..43b58760 100755 --- a/provision-contest/ansible/roles/keepalived/files/alerting/bin/alerting.sh.template +++ b/provision-contest/ansible/roles/keepalived/files/alerting/bin/alerting.sh.template @@ -1,7 +1,16 @@ -#!/bin/sh +#!/bin/bash +# Try a couple of different notification methods. + +notify-send -u critical -t 60000 "Alert: keepalived status changed at $(date '+%T') !" + +amixer -c 0 set Master 100% amixer -c 1 set Master 100% for i in 1 2 3 4 5 6 7 8 9 10 ; do aplay /usr/share/sounds/sound-icons/pipe.wav done + +beep -f 500 -l 400 -d 100 -r 4 +beep -f 1000 -l 400 -d 100 -r 4 +beep -f 500 -l 200 -d 100 -r 6 diff --git a/provision-contest/ansible/roles/keepalived/files/alerting/bin/trigger_alert.sh b/provision-contest/ansible/roles/keepalived/files/alerting/bin/trigger_alert.sh index 6c5c6fb9..72922d00 100755 --- a/provision-contest/ansible/roles/keepalived/files/alerting/bin/trigger_alert.sh +++ b/provision-contest/ansible/roles/keepalived/files/alerting/bin/trigger_alert.sh @@ -1,2 +1,7 @@ #!/bin/sh + +# This only copies the script below which contains alerting code +# A desktop autostart application started the alert_listener.sh +# script, which then detects the copy and executes it. + cp ~/bin/alerting.sh.template ~/alerting.sh diff --git a/provision-contest/ansible/roles/keepalived/tasks/main.yml b/provision-contest/ansible/roles/keepalived/tasks/main.yml index bbb89305..ae011b7f 100644 --- a/provision-contest/ansible/roles/keepalived/tasks/main.yml +++ b/provision-contest/ansible/roles/keepalived/tasks/main.yml @@ -1,11 +1,12 @@ --- # These tasks install keepalived with IP failover -- name: Install keepalived +- name: Install keepalived and beep (for alerting) apt: state: present pkg: - keepalived + - beep - name: Configure keepalived for domjudge IP failover template: