aboutsummaryrefslogtreecommitdiffstats
path: root/manifests/loadbalancer/endpoint.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/loadbalancer/endpoint.pp')
-rw-r--r--manifests/loadbalancer/endpoint.pp45
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
}
}