summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2008-06-11 15:52:02 -0700
committerStig Thormodsrud <stig@vyatta.com>2008-06-11 15:52:02 -0700
commite4b498f815db5b52b58b84d34c143520cdd19488 (patch)
treedeb7d2d3d711897a2ea9c743713197fa86b30a04
parentb4b2864a93b38e3e900164564f262b0375fcec24 (diff)
downloadvyatta-cfg-system-e4b498f815db5b52b58b84d34c143520cdd19488.tar.gz
vyatta-cfg-system-e4b498f815db5b52b58b84d34c143520cdd19488.zip
Fix 1818: Add disable option to vrrp.
-rwxr-xr-xscripts/keepalived/vyatta-keepalived.pl6
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/disable/node.def1
-rw-r--r--templates/interfaces/ethernet/node.tag/vrrp/vrrp-group/node.tag/disable/node.def1
3 files changed, 8 insertions, 0 deletions
diff --git a/scripts/keepalived/vyatta-keepalived.pl b/scripts/keepalived/vyatta-keepalived.pl
index e40c737a..ada5e367 100755
--- a/scripts/keepalived/vyatta-keepalived.pl
+++ b/scripts/keepalived/vyatta-keepalived.pl
@@ -50,6 +50,12 @@ sub keepalived_get_values {
foreach my $group (@groups) {
my $vrrp_instance = "vyatta-$intf-$group";
$config->setLevel("$path vrrp vrrp-group $group");
+ if ($config->exists("disable")) {
+ VyattaKeepalived::vrrp_log("$vrrp_instance disabled - skipping");
+ my $state_file = VyattaKeepalived::get_state_file($intf, $group);
+ system("rm -f $state_file");
+ next;
+ }
my @vips = $config->returnValues("virtual-address");
my $num_vips = scalar(@vips);
if ($num_vips == 0) {
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/disable/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/disable/node.def
new file mode 100644
index 00000000..916e313b
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/disable/node.def
@@ -0,0 +1 @@
+help: Set VRRP group disabled
diff --git a/templates/interfaces/ethernet/node.tag/vrrp/vrrp-group/node.tag/disable/node.def b/templates/interfaces/ethernet/node.tag/vrrp/vrrp-group/node.tag/disable/node.def
new file mode 100644
index 00000000..916e313b
--- /dev/null
+++ b/templates/interfaces/ethernet/node.tag/vrrp/vrrp-group/node.tag/disable/node.def
@@ -0,0 +1 @@
+help: Set VRRP group disabled