diff options
author | Daniil Baturin <daniil@baturin.org> | 2023-05-10 02:42:38 +0100 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2023-05-10 12:01:41 +0100 |
commit | 8dc6b0aa8d7bbecfc5087a7406725812779eaaf6 (patch) | |
tree | 93669fb803f76099d02b42a2c4b82930194680ec /src/conf_mode/high-availability.py | |
parent | 9495ac100114b932569592ee5ea2d4c0bba0a2a3 (diff) | |
download | vyos-1x-8dc6b0aa8d7bbecfc5087a7406725812779eaaf6.tar.gz vyos-1x-8dc6b0aa8d7bbecfc5087a7406725812779eaaf6.zip |
vrrp: T5215: Add built-in ping check for VRRP groups
Diffstat (limited to 'src/conf_mode/high-availability.py')
-rwxr-xr-x | src/conf_mode/high-availability.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/conf_mode/high-availability.py b/src/conf_mode/high-availability.py index 5e76dd9f9..7a63f5b4b 100755 --- a/src/conf_mode/high-availability.py +++ b/src/conf_mode/high-availability.py @@ -106,6 +106,13 @@ def verify(ha): if not {'password', 'type'} <= set(group_config['authentication']): raise ConfigError(f'Authentication requires both type and passwortd to be set in VRRP group "{group}"') + if 'health_check' in group_config: + from vyos.utils.dict import check_mutually_exclusive_options + try: + check_mutually_exclusive_options(group_config["health_check"], ["script", "ping"], required=True) + except ValueError as e: + raise ConfigError(f'Health check config is incorrect in VRRP group "{group}": {e}') + # Keepalived doesn't allow mixing IPv4 and IPv6 in one group, so we mirror that restriction # We also need to make sure VRID is not used twice on the same interface with the # same address family. |