Add posibility to change remote IP addresses of all HA services

Partial blueprint: detach-components-from-controllers

Change-Id: I7c328ed292567eb94e3ea93f7d630fbbd34e7d35
This commit is contained in:
Michał Górniak 2015-06-10 15:38:23 -05:00
parent c35e5cafdb
commit e33ec6c075
14 changed files with 152 additions and 35 deletions

View File

@ -1,10 +1,15 @@
# HA configuration for OpenStack Ceilometer
class openstack::ha::ceilometer {
class openstack::ha::ceilometer (
$server_names,
$ipaddresses,
) {
openstack::ha::haproxy_service { 'ceilometer':
order => '140',
listen_port => 8777,
public => true,
require_service => 'ceilometer-api',
server_names => $server_names,
ipaddresses => $ipaddresses,
}
}

View File

@ -1,11 +1,16 @@
# HA configuration for OpenStack Nova
class openstack::ha::cinder {
class openstack::ha::cinder (
$server_names,
$ipaddresses,
) {
openstack::ha::haproxy_service { 'cinder-api':
order => '070',
listen_port => 8776,
public => true,
require_service => 'cinder-api',
server_names => $server_names,
ipaddresses => $ipaddresses,
haproxy_config_options => {
option => ['httpchk', 'httplog','httpclose'],
},

View File

@ -1,5 +1,8 @@
# HA configuration for OpenStack Glance
class openstack::ha::glance {
class openstack::ha::glance (
$server_names,
$ipaddresses,
) {
openstack::ha::haproxy_service { 'glance-api':
# before neutron
@ -7,6 +10,8 @@ class openstack::ha::glance {
listen_port => 9292,
public => true,
require_service => 'glance-api',
server_names => $server_names,
ipaddresses => $ipaddresses,
haproxy_config_options => {
'option' => ['httpchk', 'httplog','httpclose'],
'timeout server' => '11m',

View File

@ -18,31 +18,94 @@ class openstack::ha::haproxy (
Haproxy::Service { use_include => true }
Haproxy::Balancermember { use_include => true }
$controllers_server_names = filter_hash($controllers, 'name')
$controllers_ipaddresses = filter_hash($controllers, 'internal_address')
Openstack::Ha::Haproxy_service {
server_names => filter_hash($controllers, 'name'),
ipaddresses => filter_hash($controllers, 'internal_address'),
server_names => $controllers_server_names,
ipaddresses => $controllers_ipaddresses,
public_virtual_ip => $public_virtual_ip,
internal_virtual_ip => $internal_virtual_ip,
}
class { 'openstack::ha::horizon': use_ssl => $horizon_use_ssl }
class { 'openstack::ha::keystone': }
class { 'openstack::ha::nova': }
class { 'openstack::ha::heat': }
class { 'openstack::ha::glance': }
class { 'openstack::ha::cinder': }
class { 'openstack::ha::horizon':
use_ssl => $horizon_use_ssl,
server_names => hiera_array('horizon_names', $controllers_server_names),
ipaddresses => hiera_array('horizon_ipaddresses', $controllers_ipaddresses),
}
if $neutron { class { 'openstack::ha::neutron': } }
class { 'openstack::ha::keystone':
server_names => hiera_array('keystone_names', $controllers_server_names),
ipaddresses => hiera_array('keystone_ipaddresses', $controllers_ipaddresses),
}
if $custom_mysql_setup_class == 'galera' {
class { 'openstack::ha::nova':
server_names => hiera_array('nova_names', $controllers_server_names),
ipaddresses => hiera_array('nova_ipaddresses', $controllers_ipaddresses),
}
class { 'openstack::ha::heat':
server_names => hiera_array('heat_names', $controllers_server_names),
ipaddresses => hiera_array('heat_ipaddresses', $controllers_ipaddresses),
}
class { 'openstack::ha::glance':
server_names => hiera_array('glance_names', $controllers_server_names),
ipaddresses => hiera_array('glance_ipaddresses', $controllers_ipaddresses),
}
class { 'openstack::ha::cinder':
server_names => hiera_array('cinder_names', $controllers_server_names),
ipaddresses => hiera_array('cinder_ipaddresses', $controllers_ipaddresses),
}
if $neutron {
class { 'openstack::ha::neutron':
server_names => hiera_array('neutron_names', $controllers_server_names),
ipaddresses => hiera_array('neutron_ipaddresses', $controllers_ipaddresses),
}
}
if $custom_mysql_setup_class == 'galera' or $custom_mysql_setup_class == 'percona' {
class { 'openstack::ha::mysqld':
is_primary_controller => $is_primary_controller,
server_names => hiera_array('mysqld_names', $controllers_server_names),
ipaddresses => hiera_array('mysqld_ipaddresses', $controllers_ipaddresses),
}
}
if $swift_proxies { class { 'openstack::ha::swift': servers => $swift_proxies } }
if $rgw_servers { class { 'openstack::ha::radosgw': servers => $rgw_servers } }
if $ceilometer { class { 'openstack::ha::ceilometer': } }
if $sahara { class { 'openstack::ha::sahara': } }
if $murano { class { 'openstack::ha::murano': } }
if $swift_proxies {
class { 'openstack::ha::swift':
server_names => hiera_array('swift_server_names', filter_hash($swift_proxies, 'name')),
ipaddresses => hiera_array('swift_ipaddresses', filter_hash($swift_proxies, 'storage_address')),
}
}
if $rgw_servers {
class { 'openstack::ha::radosgw':
server_names => hiera_array('radosgw_server_names', filter_hash($rgw_servers, 'name')),
ipaddresses => hiera_array('radosgw_ipaddresses', filter_hash($rgw_servers, 'internal_address')),
}
}
if $ceilometer {
class { 'openstack::ha::ceilometer':
server_names => hiera_array('ceilometer_names', $controllers_server_names),
ipaddresses => hiera_array('ceilometer_ipaddresses', $controllers_ipaddresses),
}
}
if $sahara {
class { 'openstack::ha::sahara':
server_names => hiera_array('sahara_names', $controllers_server_names),
ipaddresses => hiera_array('sahara_ipaddresses', $controllers_ipaddresses),
}
}
if $murano {
class { 'openstack::ha::murano':
server_names => hiera_array('murano_names', $controllers_server_names),
ipaddresses => hiera_array('murano_ipaddresses', $controllers_ipaddresses),
}
}
}

View File

@ -1,11 +1,16 @@
# HA configuration for OpenStack Nova
class openstack::ha::heat {
class openstack::ha::heat (
$server_names,
$ipaddresses,
) {
openstack::ha::haproxy_service { 'heat-api':
order => '160',
listen_port => 8004,
public => true,
require_service => 'heat-api',
server_names => $server_names,
ipaddresses => $ipaddresses,
haproxy_config_options => {
option => ['httpchk', 'httplog','httpclose'],
},

View File

@ -1,6 +1,8 @@
# HA configuration for OpenStack Horizon
class openstack::ha::horizon (
$use_ssl = false,
$server_names,
$ipaddresses,
) {
openstack::ha::haproxy_service { 'horizon':
@ -9,6 +11,8 @@ class openstack::ha::horizon (
public => true,
internal => false,
define_cookies => true,
server_names => $server_names,
ipaddresses => $ipaddresses,
haproxy_config_options => {
'option' => ['forwardfor', 'httpchk', 'httpclose', 'httplog'],

View File

@ -1,10 +1,15 @@
# HA configuration for OpenStack Keystone
class openstack::ha::keystone {
class openstack::ha::keystone (
$server_names,
$ipaddresses,
) {
openstack::ha::haproxy_service { 'keystone-1':
order => '020',
listen_port => 5000,
public => true,
server_names => $server_names,
ipaddresses => $ipaddresses,
haproxy_config_options => {
option => ['httpchk', 'httplog','httpclose'],
},

View File

@ -1,11 +1,16 @@
# HA configuration for OpenStack Murano
class openstack::ha::murano {
class openstack::ha::murano (
$server_names,
$ipaddresses,
) {
openstack::ha::haproxy_service { 'murano':
order => '180',
listen_port => 8082,
public => true,
require_service => 'murano_api',
server_names => $server_names,
ipaddresses => $ipaddresses,
}
openstack::ha::haproxy_service { 'murano_rabbitmq':

View File

@ -1,7 +1,9 @@
# HA configuration for MySQL/Galera for OpenStack
class openstack::ha::mysqld (
$is_primary_controller = false,
$before_start = false
$before_start = false,
$server_names,
$ipaddresses,
) {
openstack::ha::haproxy_service { 'mysqld':
@ -10,7 +12,8 @@ class openstack::ha::mysqld (
balancermember_port => 3307,
define_backups => true,
before_start => $before_start,
server_names => $server_names,
ipaddresses => $ipaddresses,
haproxy_config_options => {
'option' => ['httpchk', 'tcplog','clitcpka','srvtcpka'],
'balance' => 'leastconn',

View File

@ -1,11 +1,16 @@
# HA configuration for OpenStack Neutron
class openstack::ha::neutron {
class openstack::ha::neutron (
$server_names,
$ipaddresses,
) {
openstack::ha::haproxy_service { 'neutron':
order => '085',
listen_port => 9696,
public => true,
define_backups => false,
server_names => $server_names,
ipaddresses => $ipaddresses,
#NOTE(bogdando) do not add require_service => 'neutron-server', will cause a loop
haproxy_config_options => {
option => ['httpchk', 'httplog','httpclose'],

View File

@ -1,11 +1,16 @@
# HA configuration for OpenStack Nova
class openstack::ha::nova {
class openstack::ha::nova (
$server_names,
$ipaddresses,
) {
openstack::ha::haproxy_service { 'nova-api-1':
order => '040',
listen_port => 8773,
public => true,
require_service => 'nova-api',
server_names => $server_names,
ipaddresses => $ipaddresses,
haproxy_config_options => {
'timeout server' => '600s',
},

View File

@ -1,14 +1,15 @@
# HA configuration for Ceph RADOS Gateway
class openstack::ha::radosgw (
$servers,
$server_names,
$ipaddresses,
) {
openstack::ha::haproxy_service { 'radosgw':
order => '130',
listen_port => 8080,
balancermember_port => 6780,
server_names => filter_hash($servers, 'name'),
ipaddresses => filter_hash($servers, 'internal_address'),
server_names => $server_names,
ipaddresses => $ipaddresses,
public => true,
haproxy_config_options => {

View File

@ -1,10 +1,15 @@
# HA configuration for OpenStack Sahara
class openstack::ha::sahara {
class openstack::ha::sahara (
$server_names,
$ipaddresses,
) {
openstack::ha::haproxy_service { 'sahara':
order => '150',
listen_port => 8386,
public => true,
require_service => 'sahara-api',
server_names => $server_names,
ipaddresses => $ipaddresses,
}
}

View File

@ -1,13 +1,14 @@
# HA configuration for OpenStack Swift
class openstack::ha::swift (
$servers,
$server_names,
$ipaddresses,
) {
openstack::ha::haproxy_service { 'swift':
order => '120',
listen_port => 8080,
server_names => filter_hash($servers, 'name'),
ipaddresses => filter_hash($servers, 'storage_address'),
server_names => $server_names,
ipaddresses => $ipaddresses,
public => true,
haproxy_config_options => {
'option' => ['httpchk', 'httplog', 'httpclose'],