summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-05-09 19:25:24 +0200
committerGitHub <noreply@github.com>2023-05-09 19:25:24 +0200
commit6a150eb26c97e41a66bfb693bfc0ad09c4f4fd2c (patch)
tree8f59bb8940a1c050d599d3627acefcd10245b5ed
parent73ec6fd55d1881e9ca0439a993e9bda8e06d1448 (diff)
parente201454f073c9a92fb56b65f497eae55fc634521 (diff)
downloadvyos-1x-6a150eb26c97e41a66bfb693bfc0ad09c4f4fd2c.tar.gz
vyos-1x-6a150eb26c97e41a66bfb693bfc0ad09c4f4fd2c.zip
Merge pull request #1984 from sever-sever/T5060
T5060: Add disable option for high-availability
-rw-r--r--interface-definitions/high-availability.xml.in1
-rwxr-xr-xsrc/conf_mode/high-availability.py6
2 files changed, 4 insertions, 3 deletions
diff --git a/interface-definitions/high-availability.xml.in b/interface-definitions/high-availability.xml.in
index ce6603796..9b52fe82e 100644
--- a/interface-definitions/high-availability.xml.in
+++ b/interface-definitions/high-availability.xml.in
@@ -6,6 +6,7 @@
<help>High availability settings</help>
</properties>
<children>
+ #include <include/generic-disable-node.xml.i>
<node name="vrrp">
<properties>
<help>Virtual Router Redundancy Protocol settings</help>
diff --git a/src/conf_mode/high-availability.py b/src/conf_mode/high-availability.py
index 79e407efd..5e76dd9f9 100755
--- a/src/conf_mode/high-availability.py
+++ b/src/conf_mode/high-availability.py
@@ -86,7 +86,7 @@ def get_config(config=None):
return ha
def verify(ha):
- if not ha:
+ if not ha or 'disable' in ha:
return None
used_vrid_if = []
@@ -175,7 +175,7 @@ def verify(ha):
def generate(ha):
- if not ha:
+ if not ha or 'disable' in ha:
return None
render(VRRP.location['config'], 'high-availability/keepalived.conf.j2', ha)
@@ -183,7 +183,7 @@ def generate(ha):
def apply(ha):
service_name = 'keepalived.service'
- if not ha:
+ if not ha or 'disable' in ha:
call(f'systemctl stop {service_name}')
return None