summaryrefslogtreecommitdiffstats
path: root/build/opnfv-puppet-tripleo.patch
blob: 99d3c742867d956c86eda4b3a76f65cb01ef08a8 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
From 9f012bc3e4f23fa756f5435ee69e5d51dd6fc874 Mon Sep 17 00:00:00 2001
From: Tim Rozet <tdrozet@gmail.com>
Date: Thu, 3 Mar 2016 14:36:11 -0500
Subject: [PATCH] Adds ODL to load balancer

---
 manifests/loadbalancer.pp | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/manifests/loadbalancer.pp b/manifests/loadbalancer.pp
index 2fcfac6..6e13566 100644
--- a/manifests/loadbalancer.pp
+++ b/manifests/loadbalancer.pp
@@ -247,6 +247,10 @@
 #  (optional) Enable or not Redis binding
 #  Defaults to false
 #
+# [*opendaylight*]
+#  (optional) Enable or not OpenDaylight binding
+#  Defaults to false
+#
 class tripleo::loadbalancer (
   $controller_virtual_ip,
   $control_virtual_interface,
@@ -299,6 +303,7 @@ class tripleo::loadbalancer (
   $mysql_clustercheck        = false,
   $rabbitmq                  = false,
   $redis                     = false,
+  $opendaylight              = false,
 ) {
 
   if !$controller_host and !$controller_hosts {
@@ -1044,4 +1049,26 @@ class tripleo::loadbalancer (
     }
   }
 
+  $opendaylight_api_vip = hiera('opendaylight_api_vip', $controller_virtual_ip)
+  $opendaylight_bind_opts = {
+    "${opendaylight_api_vip}:8081" => [],
+    "${public_virtual_ip}:8081" => [],
+  }
+
+  if $opendaylight {
+    haproxy::listen { 'opendaylight':
+      bind             => $opendaylight_bind_opts,
+      options          => {
+        'balance'   => 'source',
+      },
+      collect_exported => false,
+    }
+    haproxy::balancermember { 'opendaylight':
+      listening_service => 'opendaylight',
+      ports             => '8081',
+      ipaddresses       => hiera('opendaylight_api_node_ips', $controller_hosts_real),
+      server_names      => $controller_hosts_names_real,
+      options           => ['check', 'inter 2000', 'rise 2', 'fall 5'],
+    }
+  }
 }
-- 
2.5.0