Adds ODL HA support 11/55611/1
authorTim Rozet <tdrozet@gmail.com>
Mon, 29 Feb 2016 21:30:01 +0000 (16:30 -0500)
committerDaniel Farrell <dfarrell@redhat.com>
Wed, 19 Apr 2017 19:18:40 +0000 (15:18 -0400)
Change-Id: I86e30f85606d3bac4b1e9bc6cc38628be03061f2
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
files/jolokia.xml [new file with mode: 0644]
manifests/config.pp
manifests/init.pp
manifests/params.pp

diff --git a/files/jolokia.xml b/files/jolokia.xml
new file mode 100644 (file)
index 0000000..e957099
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<features name="jolokia-1.1.5" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0">
+    <feature name='feature-jolokia' version='1.1.5' install="auto">
+       <bundle>mvn:org.jolokia/jolokia-osgi/1.1.5</bundle>
+    </feature>
+</features>
index 3a64c68998314f1e581c6a748173b6234e64f6d5..8caa8bfeb62a4af2b5013d91502fa1f60ad5b38f 100644 (file)
@@ -51,4 +51,28 @@ class opendaylight::config {
     # Use a template to populate the content
     content => template('opendaylight/org.ops4j.pax.logging.cfg.erb'),
   }
+
+  # Configure ODL HA if enabled
+  $ha_node_count = count($::opendaylight::ha_node_ips)
+  if $::opendaylight::enable_ha {
+    if $ha_node_count >= 2 {
+      # Configuration Jolokia XML for HA
+      file { 'opendaylight/jolokia.xml':
+        ensure  => file,
+        path    => '/opt/opendaylight/deploy/jolokia.xml',
+        # Set user:group owners
+        owner   => 'odl',
+        group   => 'odl',
+      }
+
+      # Configure ODL OSVDB Clustering
+      $ha_node_ip_str = join($::opendaylight::ha_node_ips, ' ')
+      exec { 'Configure ODL OVSDB Clustering':
+        command => "configure_cluster.sh ${::opendaylight::ha_node_index} ${ha_node_ip_str}",
+        path    => '/opt/opendaylight/bin/',
+      }
+    } else {
+      fail("Number of HA nodes less than 2: ${ha_node_count} and HA Enabled")
+    }
+  }
 }
index b875ed2d62ccd6f23cb34e19d5d7d80604a9e0b4..6313e2296f3c172b4828b2cd527d93a3331a3c87 100644 (file)
 #   Enable or disable ODL OVSDB ML2 L3 forwarding. Valid: true, false, 'yes' and 'no'.
 # [*log_levels*]
 #   Custom OpenDaylight logger verbosity configuration (TRACE, DEBUG, INFO, WARN, ERROR).
+# [*enable_ha*]
+#   Enable or disable ODL OVSDB HA Clustering. Valid: true or false. Default: false.
+# [*ha_node_ips*]
+#   Array of IPs for each node in the HA cluster.
+# [*ha_node_index*]
+#   Index of ha_node_ips for this node.
 #
 class opendaylight (
   $default_features = $::opendaylight::params::default_features,
@@ -29,6 +35,9 @@ class opendaylight (
   $odl_rest_port = $::opendaylight::params::odl_rest_port,
   $enable_l3 = $::opendaylight::params::enable_l3,
   $log_levels = $::opendaylight::params::log_levels,
+  $enable_ha = $::opendaylight::params::enable_ha,
+  $ha_node_ips = $::opendaylight::params::ha_node_ips,
+  $ha_node_index = $::opendaylight::params::ha_node_index,
 ) inherits ::opendaylight::params {
 
   # Validate OS family
index 17aaea2bab3a9ebeee821a85db244a63986e01be..9d51c2770a0823a4788d5b8be09386bc9df0efef 100644 (file)
@@ -17,4 +17,7 @@ class opendaylight::params {
   $odl_rest_port = '8080'
   $enable_l3 = 'no'
   $log_levels = {}
+  $enable_ha = false
+  $ha_node_ips = []
+  $ha_node_index = ''
 }