diff options
Diffstat (limited to 'manifests/loadbalancer.pp')
-rw-r--r-- | manifests/loadbalancer.pp | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/manifests/loadbalancer.pp b/manifests/loadbalancer.pp index 56238f3..6b5999a 100644 --- a/manifests/loadbalancer.pp +++ b/manifests/loadbalancer.pp @@ -138,6 +138,10 @@ # (optional) Enable or not RabbitMQ binding # Defaults to false # +# [*redis*] +# (optional) Enable or not Redis binding +# Defaults to false +# class tripleo::loadbalancer ( $controller_virtual_ip, $control_virtual_interface, @@ -167,6 +171,7 @@ class tripleo::loadbalancer ( $horizon = false, $mysql = false, $rabbitmq = false, + $redis = false, ) { if !$controller_host and !$controller_hosts { @@ -249,11 +254,11 @@ class tripleo::loadbalancer ( } haproxy::listen { 'haproxy.stats': - ipaddress => '*', + ipaddress => $controller_virtual_ip, ports => '1993', mode => 'http', options => { - 'stats' => 'enable', + 'stats' => ['enable', 'uri /'], }, collect_exported => false, } @@ -574,7 +579,7 @@ class tripleo::loadbalancer ( if $rabbitmq { haproxy::listen { 'rabbitmq': - ipaddress => [$controller_virtual_ip, $public_virtual_ip], + ipaddress => [$controller_virtual_ip], ports => 5672, options => { 'timeout' => [ 'client 0', 'server 0' ], @@ -590,4 +595,26 @@ class tripleo::loadbalancer ( } } + if $redis { + haproxy::listen { 'redis': + ipaddress => [$controller_virtual_ip], + ports => 6379, + options => { + 'timeout' => [ 'client 0', 'server 0' ], + 'mode' => 'tcp', + 'balance' => 'first', + 'option' => ['tcp-check',], + 'tcp-check' => ['send info\ replication\r\n','expect string role:master'], + }, + collect_exported => false, + } + haproxy::balancermember { 'redis': + listening_service => 'redis', + ports => '6379', + ipaddresses => $controller_hosts_real, + server_names => $controller_hosts_names_real, + options => ['check', 'inter 2000', 'rise 2', 'fall 5'], + } + } + } |