diff options
author | Emilien Macchi <emilien@redhat.com> | 2016-05-25 15:37:01 -0400 |
---|---|---|
committer | Emilien Macchi <emilien@redhat.com> | 2016-05-26 16:58:27 -0400 |
commit | 7b355dcc63e24dbb730e135b4148e500e6de4233 (patch) | |
tree | 63252670851590e744f264de71a68b0f477d7fc8 /manifests/loadbalancer | |
parent | 727d1b006a619b3639bee3557942d15329286839 (diff) |
Explode loadbalancer role in 2 sub-roles
Split loadbalancer role into 2 sub-roles:
- HAproxy
- Keepalived
Change-Id: I84dfa9d409d390c6f549d62cb3634931e4cb432c
Diffstat (limited to 'manifests/loadbalancer')
-rw-r--r-- | manifests/loadbalancer/endpoint.pp | 45 |
1 files changed, 13 insertions, 32 deletions
diff --git a/manifests/loadbalancer/endpoint.pp b/manifests/loadbalancer/endpoint.pp index f75f79a..add6689 100644 --- a/manifests/loadbalancer/endpoint.pp +++ b/manifests/loadbalancer/endpoint.pp @@ -84,37 +84,18 @@ define tripleo::loadbalancer::endpoint ( $public_certificate = undef, $internal_certificate = undef, ) { - if $public_virtual_ip { - # service exposed to the public network - - if $public_certificate { - $public_bind_opts = list_to_hash(suffix(any2array($public_virtual_ip), ":${public_ssl_port}"), union($haproxy_listen_bind_param, ['ssl', 'crt', $public_certificate])) - } else { - $public_bind_opts = list_to_hash(suffix(any2array($public_virtual_ip), ":${service_port}"), $haproxy_listen_bind_param) - } - } else { - # internal service only - $public_bind_opts = {} - } - - if $internal_certificate { - $internal_bind_opts = list_to_hash(suffix(any2array($internal_ip), ":${service_port}"), union($haproxy_listen_bind_param, ['ssl', 'crt', $public_certificate])) - } else { - $internal_bind_opts = list_to_hash(suffix(any2array($internal_ip), ":${service_port}"), $haproxy_listen_bind_param) - } - $bind_opts = merge($internal_bind_opts, $public_bind_opts) - - haproxy::listen { "${name}": - bind => $bind_opts, - collect_exported => false, - mode => $mode, - options => $listen_options, - } - haproxy::balancermember { "${name}": - listening_service => $name, - ports => $service_port, - ipaddresses => $ip_addresses, - server_names => $server_names, - options => $member_options, + ::tripleo::haproxy::endpoint { $name: + internal_ip => $internal_ip, + service_port => $service_port, + ip_addresses => $ip_addresses, + server_names => $server_names, + member_options => $member_options, + public_virtual_ip => $public_virtual_ip, + mode => $mode, + haproxy_listen_bind_param => $haproxy_listen_bind_param, + listen_options => $listen_options, + public_ssl_port => $public_ssl_port, + public_certificate => $public_certificate, + internal_certificate => $internal_certificate } } |