Enable support for loadbalancing Ironic

Just like any other OpenStack API endpoint.

Change-Id: Iaa45d7bef94c3c42df0988a58f146bb8a530f74e
This commit is contained in:
Ben Nemec 2015-06-24 22:44:19 +00:00
parent f0d5f3aa0d
commit 73550e2941
1 changed files with 43 additions and 0 deletions

View File

@ -132,6 +132,11 @@
# When set, enables SSL on the Horizon public API endpoint using the specified file.
# Defaults to undef
#
# [*ironic_certificate*]
# Filename of an HAProxy-compatible certificate and key file
# When set, enables SSL on the Ironic public API endpoint using the specified file.
# Defaults to undef
#
# [*galera_master_hostname*]
# FQDN of the Galera master node
# Defaults to undef
@ -204,6 +209,10 @@
# (optional) Enable or not Horizon dashboard binding
# Defaults to false
#
# [*ironic*]
# (optional) Enable or not Ironic API binding
# Defaults to false
#
# [*mysql*]
# (optional) Enable or not MySQL Galera binding
# Defaults to false
@ -240,6 +249,7 @@ class tripleo::loadbalancer (
$swift_certificate = undef,
$heat_certificate = undef,
$horizon_certificate = undef,
$ironic_certificate = undef,
$galera_master_hostname = undef,
$galera_master_ip = undef,
$keystone_admin = false,
@ -258,6 +268,7 @@ class tripleo::loadbalancer (
$heat_cloudwatch = false,
$heat_cfn = false,
$horizon = false,
$ironic = false,
$mysql = false,
$rabbitmq = false,
$redis = false,
@ -404,6 +415,11 @@ class tripleo::loadbalancer (
} else {
$horizon_bind_certificate = $service_certificate
}
if $ironic_certificate {
$ironic_bind_certificate = $ironic_certificate
} else {
$ironic_bind_certificate = $service_certificate
}
$keystone_public_api_vip = hiera('keystone_public_api_vip', $controller_virtual_ip)
$keystone_admin_api_vip = hiera('keystone_admin_api_vip', $controller_virtual_ip)
@ -563,6 +579,19 @@ class tripleo::loadbalancer (
}
}
$ironic_api_vip = hiera('ironic_api_vip', $controller_virtual_ip)
if $ironic_bind_certificate {
$ironic_bind_opts = {
"${ironic_api_vip}:8080" => [],
"${public_virtual_ip}:13080" => ['ssl', 'crt', $ironic_bind_certificate],
}
} else {
$ironic_bind_opts = {
"${ironic_api_vip}:8080" => [],
"${public_virtual_ip}:8080" => [],
}
}
sysctl::value { 'net.ipv4.ip_nonlocal_bind': value => '1' }
class { '::haproxy':
@ -865,6 +894,20 @@ class tripleo::loadbalancer (
}
}
if $ironic {
haproxy::listen { 'ironic':
bind => $ironic_bind_opts,
collect_exported => false,
}
haproxy::balancermember { 'ironic':
listening_service => 'ironic',
ports => '6385',
ipaddresses => hiera('ironic_api_node_ips', $controller_hosts_real),
server_names => $controller_hosts_names_real,
options => [],
}
}
if $mysql {
haproxy::listen { 'mysql':
ipaddress => [hiera('mysql_vip', $controller_virtual_ip)],