Merge "Updates to Caching"
[apex.git] / build / opnfv-puppet-tripleo.patch
1 From 9f012bc3e4f23fa756f5435ee69e5d51dd6fc874 Mon Sep 17 00:00:00 2001
2 From: Tim Rozet <tdrozet@gmail.com>
3 Date: Thu, 3 Mar 2016 14:36:11 -0500
4 Subject: [PATCH] Adds ODL to load balancer
5
6 ---
7  manifests/loadbalancer.pp | 27 +++++++++++++++++++++++++++
8  1 file changed, 27 insertions(+)
9
10 diff --git a/manifests/loadbalancer.pp b/manifests/loadbalancer.pp
11 index 2fcfac6..6e13566 100644
12 --- a/manifests/loadbalancer.pp
13 +++ b/manifests/loadbalancer.pp
14 @@ -247,6 +247,10 @@
15  #  (optional) Enable or not Redis binding
16  #  Defaults to false
17  #
18 +# [*opendaylight*]
19 +#  (optional) Enable or not OpenDaylight binding
20 +#  Defaults to false
21 +#
22  class tripleo::loadbalancer (
23    $controller_virtual_ip,
24    $control_virtual_interface,
25 @@ -299,6 +303,7 @@ class tripleo::loadbalancer (
26    $mysql_clustercheck        = false,
27    $rabbitmq                  = false,
28    $redis                     = false,
29 +  $opendaylight              = false,
30  ) {
31  
32    if !$controller_host and !$controller_hosts {
33 @@ -1044,4 +1049,26 @@ class tripleo::loadbalancer (
34      }
35    }
36  
37 +  $opendaylight_api_vip = hiera('opendaylight_api_vip', $controller_virtual_ip)
38 +  $opendaylight_bind_opts = {
39 +    "${opendaylight_api_vip}:8081" => [],
40 +    "${public_virtual_ip}:8081" => [],
41 +  }
42 +
43 +  if $opendaylight {
44 +    haproxy::listen { 'opendaylight':
45 +      bind             => $opendaylight_bind_opts,
46 +      options          => {
47 +        'balance'   => 'source',
48 +      },
49 +      collect_exported => false,
50 +    }
51 +    haproxy::balancermember { 'opendaylight':
52 +      listening_service => 'opendaylight',
53 +      ports             => '8081',
54 +      ipaddresses       => hiera('opendaylight_api_node_ips', $controller_hosts_real),
55 +      server_names      => $controller_hosts_names_real,
56 +      options           => ['check', 'inter 2000', 'rise 2', 'fall 5'],
57 +    }
58 +  }
59  }
60 -- 
61 2.5.0
62