summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-09-21 22:04:13 +0200
committerChristian Poessinger <christian@poessinger.com>2021-09-21 22:06:38 +0200
commit2a57f786931793d59cc5ec2c3a925807b6ee3938 (patch)
tree5bad68a999d7125f4df91760e73669a9dc841ae1
parent407db335b8eda0c9b8a090cde806a9107d3dbd96 (diff)
downloadvyos-1x-2a57f786931793d59cc5ec2c3a925807b6ee3938.tar.gz
vyos-1x-2a57f786931793d59cc5ec2c3a925807b6ee3938.zip
vrrp: keepalived: T3847: add common transition-script building block
This is used for both VRRP groups and sync-groups.
-rw-r--r--interface-definitions/include/vrrp-transition-script.xml.i41
-rw-r--r--interface-definitions/vrrp.xml.in80
2 files changed, 43 insertions, 78 deletions
diff --git a/interface-definitions/include/vrrp-transition-script.xml.i b/interface-definitions/include/vrrp-transition-script.xml.i
new file mode 100644
index 000000000..cf57c3c74
--- /dev/null
+++ b/interface-definitions/include/vrrp-transition-script.xml.i
@@ -0,0 +1,41 @@
+<!-- include start from vrrp-transition-script.xml.i -->
+<node name="transition-script">
+ <properties>
+ <help>VRRP transition scripts</help>
+ </properties>
+ <children>
+ <leafNode name="master">
+ <properties>
+ <help>Script to run on VRRP state transition to master</help>
+ <constraint>
+ <validator name="script"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="backup">
+ <properties>
+ <help>Script to run on VRRP state transition to backup</help>
+ <constraint>
+ <validator name="script"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="fault">
+ <properties>
+ <help>Script to run on VRRP state transition to fault</help>
+ <constraint>
+ <validator name="script"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ <leafNode name="stop">
+ <properties>
+ <help>Script to run on VRRP state transition to stop</help>
+ <constraint>
+ <validator name="script"/>
+ </constraint>
+ </properties>
+ </leafNode>
+ </children>
+</node>
+<!-- include end -->
diff --git a/interface-definitions/vrrp.xml.in b/interface-definitions/vrrp.xml.in
index d43ff83de..44bd7e454 100644
--- a/interface-definitions/vrrp.xml.in
+++ b/interface-definitions/vrrp.xml.in
@@ -184,45 +184,7 @@
<valueless/>
</properties>
</leafNode>
- <node name="transition-script">
- <properties>
- <help>VRRP transition scripts</help>
- </properties>
- <children>
- <leafNode name="master">
- <properties>
- <help>Script to run on VRRP state transition to master</help>
- <constraint>
- <validator name="script"/>
- </constraint>
- </properties>
- </leafNode>
- <leafNode name="backup">
- <properties>
- <help>Script to run on VRRP state transition to backup</help>
- <constraint>
- <validator name="script"/>
- </constraint>
- </properties>
- </leafNode>
- <leafNode name="fault">
- <properties>
- <help>Script to run on VRRP state transition to fault</help>
- <constraint>
- <validator name="script"/>
- </constraint>
- </properties>
- </leafNode>
- <leafNode name="stop">
- <properties>
- <help>Script to run on VRRP state transition to stop</help>
- <constraint>
- <validator name="script"/>
- </constraint>
- </properties>
- </leafNode>
- </children>
- </node>
+ #include <include/vrrp-transition-script.xml.i>
<leafNode name="virtual-address">
<properties>
<help>Virtual address (IPv4 or IPv6, but they must not be mixed in one group)</help>
@@ -293,45 +255,7 @@
</completionHelp>
</properties>
</leafNode>
- <node name="transition-script">
- <properties>
- <help>VRRP transition scripts</help>
- </properties>
- <children>
- <leafNode name="master">
- <properties>
- <help>Script to run on VRRP state transition to master</help>
- <constraint>
- <validator name="script"/>
- </constraint>
- </properties>
- </leafNode>
- <leafNode name="backup">
- <properties>
- <help>Script to run on VRRP state transition to backup</help>
- <constraint>
- <validator name="script"/>
- </constraint>
- </properties>
- </leafNode>
- <leafNode name="fault">
- <properties>
- <help>Script to run on VRRP state transition to fault</help>
- <constraint>
- <validator name="script"/>
- </constraint>
- </properties>
- </leafNode>
- <leafNode name="stop">
- <properties>
- <help>Script to run on VRRP state transition to stop</help>
- <constraint>
- <validator name="script"/>
- </constraint>
- </properties>
- </leafNode>
- </children>
- </node>
+ #include <include/vrrp-transition-script.xml.i>
</children>
</tagNode>
</children>