diff --git a/ansible/group_vars/all/kuma.yaml b/ansible/group_vars/all/kuma.yaml new file mode 100644 index 0000000..a8c9246 --- /dev/null +++ b/ansible/group_vars/all/kuma.yaml @@ -0,0 +1,2 @@ +--- +heartbeat_timer_interval: 300 diff --git a/ansible/host_vars/thonkpad.ka.chaoswg.org/override.yaml b/ansible/host_vars/thonkpad.ka.chaoswg.org/override.yaml new file mode 100644 index 0000000..d80a73b --- /dev/null +++ b/ansible/host_vars/thonkpad.ka.chaoswg.org/override.yaml @@ -0,0 +1,2 @@ +--- +heartbeat_timer_interval: 60 diff --git a/ansible/plays/common.yaml b/ansible/plays/common.yaml index 91ed0d2..d413cfe 100644 --- a/ansible/plays/common.yaml +++ b/ansible/plays/common.yaml @@ -246,7 +246,7 @@ name: "{{ inventory_hostname }}" description: "Managed by Ansible" type: push - interval: 330 + interval: "{{ heartbeat_timer_interval|mandatory + 30 }}" maxretries: 2 notification_names: - "Kuma Statusmonitor" diff --git a/ansible/plays/templates/heartbeat.timer.j2 b/ansible/plays/templates/heartbeat.timer.j2 index f57344b..c8554d8 100644 --- a/ansible/plays/templates/heartbeat.timer.j2 +++ b/ansible/plays/templates/heartbeat.timer.j2 @@ -1,9 +1,9 @@ [Unit] -Description=Send heartbeat every 5 minutes +Description=Notify Kuma that this node is alive [Timer] -OnCalendar=*-*-* *:00/5:00 -Persistent=true +OnActiveSec={{ heartbeat_timer_interval }} +OnUnitActiveSec={{ heartbeat_timer_interval }} [Install] WantedBy=timers.target