diff options
Diffstat (limited to 'manifests/haproxy.pp')
-rw-r--r-- | manifests/haproxy.pp | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/manifests/haproxy.pp b/manifests/haproxy.pp index e2b2cc9..b2cc264 100644 --- a/manifests/haproxy.pp +++ b/manifests/haproxy.pp @@ -228,6 +228,10 @@ # # [*zaqar_api*] # (optional) Enable or not Zaqar Api binding +# Defaults to false +# +# [*opendaylight*] +# (optional) Enable or not OpenDaylight binding # Defaults to false # # [*service_ports*] @@ -329,6 +333,7 @@ class tripleo::haproxy ( $redis_password = undef, $midonet_api = false, $zaqar_api = false, + $opendaylight = false, $service_ports = {} ) { $default_service_ports = { @@ -881,7 +886,12 @@ class tripleo::haproxy ( options => { 'balance' => 'first', 'option' => ['tcp-check',], - 'tcp-check' => union($redis_tcp_check_options, ['send PING\r\n','expect string +PONG','send info\ replication\r\n','expect string role:master','send QUIT\r\n','expect string +OK']), + 'tcp-check' => union($redis_tcp_check_options, ['send PING\r\n', + 'expect string +PONG', + 'send info\ replication\r\n', + 'expect string role:master', + 'send QUIT\r\n', + 'expect string +OK']), }, collect_exported => false, } @@ -924,4 +934,27 @@ class tripleo::haproxy ( public_ssl_port => $ports[zaqar_api_ssl_port], } } + + $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'], + } + } } |