summaryrefslogtreecommitdiffstats
path: root/build/patches/disable_odl_clustering.patch
blob: 151481fcc34b0958b13255335ab841e382abcfdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
diff --git a/manifests/profile/base/neutron/opendaylight.pp b/manifests/profile/base/neutron/opendaylight.pp
index 3269f3e..556fe63 100644
--- a/manifests/profile/base/neutron/opendaylight.pp
+++ b/manifests/profile/base/neutron/opendaylight.pp
@@ -22,34 +22,19 @@
 #   (Optional) The current step of the deployment
 #   Defaults to hiera('step')
 #
-# [*odl_api_ips*]
-#   (Optional) List of OpenStack Controller IPs for ODL API
-#   Defaults to hiera('opendaylight_api_node_ips')
-#
-# [*node_name*]
-#   (Optional) The short hostname of node
-#   Defaults to hiera('bootstack_nodeid')
+# [*primary_node*]
+#   (Optional) The hostname of the first node of this role type
+#   Defaults to hiera('bootstrap_nodeid', undef)
 #
 class tripleo::profile::base::neutron::opendaylight (
   $step         = hiera('step'),
-  $odl_api_ips  = hiera('opendaylight_api_node_ips'),
-  $node_name    = hiera('bootstack_nodeid')
+  $primary_node = hiera('bootstrap_nodeid', undef),
 ) {
 
   if $step >= 1 {
-    if empty($odl_api_ips) {
-      fail('No IPs assigned to OpenDaylight Api Service')
-    } elsif size($odl_api_ips) == 2 {
-      fail('2 node OpenDaylight deployments are unsupported.  Use 1 or greater than 2')
-    } elsif size($odl_api_ips) > 2 {
-      $node_string = split($node_name, '-')
-      $ha_node_index = $node_string[-1] + 1
-      class { '::opendaylight':
-        enable_ha     => true,
-        ha_node_ips   => $odl_api_ips,
-        ha_node_index => $ha_node_index,
-      }
-    } else {
+    # Configure ODL only on first node of the role where this service is
+    # applied
+    if $primary_node == downcase($::hostname) {
       include ::opendaylight
     }
   }