summaryrefslogtreecommitdiff
path: root/data/templates/high-availability
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2023-05-10 02:42:38 +0100
committerDaniil Baturin <daniil@baturin.org>2023-05-10 12:01:41 +0100
commit8dc6b0aa8d7bbecfc5087a7406725812779eaaf6 (patch)
tree93669fb803f76099d02b42a2c4b82930194680ec /data/templates/high-availability
parent9495ac100114b932569592ee5ea2d4c0bba0a2a3 (diff)
downloadvyos-1x-8dc6b0aa8d7bbecfc5087a7406725812779eaaf6.tar.gz
vyos-1x-8dc6b0aa8d7bbecfc5087a7406725812779eaaf6.zip
vrrp: T5215: Add built-in ping check for VRRP groups
Diffstat (limited to 'data/templates/high-availability')
-rw-r--r--data/templates/high-availability/keepalived.conf.j28
1 files changed, 6 insertions, 2 deletions
diff --git a/data/templates/high-availability/keepalived.conf.j2 b/data/templates/high-availability/keepalived.conf.j2
index 6ea5f91d0..85b89c70c 100644
--- a/data/templates/high-availability/keepalived.conf.j2
+++ b/data/templates/high-availability/keepalived.conf.j2
@@ -32,9 +32,13 @@ global_defs {
{% if vrrp.group is vyos_defined %}
{% for name, group_config in vrrp.group.items() if group_config.disable is not vyos_defined %}
-{% if group_config.health_check.script is vyos_defined %}
+{% if group_config.health_check is vyos_defined %}
vrrp_script healthcheck_{{ name }} {
+{% if group_config.health_check.script is vyos_defined %}
script "{{ group_config.health_check.script }}"
+{% elif group_config.health_check.ping is vyos_defined %}
+ script "/usr/bin/ping -c1 {{ group_config.health_check.ping }}"
+{% endif %}
interval {{ group_config.health_check.interval }}
fall {{ group_config.health_check.failure_count }}
rise 1
@@ -121,7 +125,7 @@ vrrp_instance {{ name }} {
{% endfor %}
}
{% endif %}
-{% if group_config.health_check.script is vyos_defined %}
+{% if group_config.health_check is vyos_defined %}
track_script {
healthcheck_{{ name }}
}