Remove hardcoded network roles from HAproxy manifests
This commit removed some hardcoded network roles from HAproxy manifests and replaces them with globals. Also it fixes hiera override functionality for some globals. Change-Id: Ia6006b19f366cec8ac686e19e7b921e95051c1ac Closes-Bug: #1505604
This commit is contained in:
parent
ba7ed96778
commit
aacacc9bf9
|
@ -28,7 +28,8 @@ if empty($node) {
|
|||
prepare_network_config($network_scheme)
|
||||
|
||||
# DEPRICATED
|
||||
$nodes_hash = hiera('nodes', {})
|
||||
# nodes_hash is actually an array, not a hash
|
||||
$nodes_hash = hiera('nodes', {})
|
||||
|
||||
# MOS Ubuntu image uses Debian style packages. Since the introduction
|
||||
# of `$::os_package_type' fact avilable to use in project manifests,
|
||||
|
@ -70,7 +71,8 @@ $swift_hash = hiera('swift', {})
|
|||
$cinder_hash = hiera_hash('cinder', {})
|
||||
$ceilometer_hash = hiera('ceilometer',{})
|
||||
$access_hash = hiera_hash('access', {})
|
||||
$mp_hash = hiera('mp', {})
|
||||
# mp_hash is actually an array, not a hash
|
||||
$mp_hash = hiera('mp', [])
|
||||
$keystone_hash = merge({'service_token_off' => $service_token_off},
|
||||
hiera_hash('keystone', {}))
|
||||
|
||||
|
@ -263,8 +265,8 @@ if roles_include('primary-controller') {
|
|||
$primary_controller = false
|
||||
}
|
||||
|
||||
$controllers_hash = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
|
||||
$mountpoints = filter_hash($mp_hash,'point')
|
||||
$controller_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
|
||||
$mountpoints = filter_hash($mp_hash, 'point')
|
||||
|
||||
# AMQP configuration
|
||||
$queue_provider = hiera('queue_provider','rabbitmq')
|
||||
|
@ -281,7 +283,7 @@ if hiera('amqp_hosts', false) {
|
|||
} else {
|
||||
# using RabbitMQ servers on controllers
|
||||
# todo(sv): switch from 'controller' nodes to 'rmq' nodes as soon as it was implemented as additional node-role
|
||||
$controllers_with_amqp_server = get_node_to_ipaddr_map_by_network_role($controllers_hash, 'mgmt/messaging')
|
||||
$controllers_with_amqp_server = get_node_to_ipaddr_map_by_network_role($controller_nodes, 'mgmt/messaging')
|
||||
$amqp_nodes = ipsort(values($controllers_with_amqp_server))
|
||||
# amqp_hosts() randomize order of RMQ endpoints and put local one first
|
||||
$amqp_hosts = amqp_hosts($amqp_nodes, $amqp_port, get_network_role_property('mgmt/messaging', 'ipaddr'))
|
||||
|
@ -311,8 +313,8 @@ if (member($roles, 'cinder') and $storage_hash['volumes_lvm']) {
|
|||
|
||||
# Define ceph-related variables
|
||||
$ceph_primary_monitor_node = get_nodes_hash_by_roles($network_metadata, ['primary-controller'])
|
||||
$ceph_monitor_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
|
||||
$ceph_rgw_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
|
||||
$ceph_monitor_nodes = $controller_nodes
|
||||
$ceph_rgw_nodes = $controller_nodes
|
||||
|
||||
#Determine who should be the default backend
|
||||
if ($storage_hash['images_ceph']) {
|
||||
|
@ -326,9 +328,15 @@ if ($storage_hash['images_ceph']) {
|
|||
$glance_known_stores = false
|
||||
}
|
||||
|
||||
# Define keystone-related variables:
|
||||
$keystone_nodes = $controller_nodes
|
||||
|
||||
# Define glance-related variables:
|
||||
$glance_nodes = $controller_nodes
|
||||
|
||||
# Define ceilometer-related variables:
|
||||
# todo: use special node-roles instead controllers in the future
|
||||
$ceilometer_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
|
||||
$ceilometer_nodes = $controller_nodes
|
||||
|
||||
# Define memcached-related variables:
|
||||
$memcache_roles = hiera('memcache_roles', ['primary-controller', 'controller'])
|
||||
|
@ -338,14 +346,14 @@ $corosync_roles = hiera('corosync_roles', ['primary-controller', 'controller'])
|
|||
|
||||
# Define cinder-related variables
|
||||
# todo: use special node-roles instead controllers in the future
|
||||
$cinder_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
|
||||
$cinder_nodes = $controller_nodes
|
||||
|
||||
# Define horizon-related variables:
|
||||
# todo: use special node-roles instead controllers in the future
|
||||
$horizon_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
|
||||
$horizon_nodes = $controller_nodes
|
||||
|
||||
# Define swift-related variables
|
||||
$swift_master_role = hiera('swift_master_role', 'primary-controller')
|
||||
$swift_master_role = hiera('swift_master_role', 'primary-controller')
|
||||
|
||||
# Plugins may define custom role names before this 'globals' task.
|
||||
# If no custom role are defined, the default one are used.
|
||||
|
@ -362,13 +370,16 @@ $swift_proxy_caches = $swift_proxies # memcache for swift
|
|||
$is_primary_swift_proxy = $primary_controller
|
||||
|
||||
# Define murano-related variables
|
||||
$murano_roles = ['primary-controller', 'controller']
|
||||
$murano_roles = hiera('murano_roles', ['primary-controller', 'controller'])
|
||||
$murano_nodes = get_nodes_hash_by_roles($network_metadata, $murano_roles)
|
||||
|
||||
# Define heat-related variables:
|
||||
$heat_roles = ['primary-controller', 'controller']
|
||||
$heat_roles = hiera('heat_roles', ['primary-controller', 'controller'])
|
||||
$heat_nodes = get_nodes_hash_by_roles($network_metadata, $heat_roles)
|
||||
|
||||
# Define sahara-related variable
|
||||
$sahara_roles = ['primary-controller', 'controller']
|
||||
$sahara_roles = hiera('sahara_roles', ['primary-controller', 'controller'])
|
||||
$sahara_nodes = get_nodes_hash_by_roles($network_metadata, $sahara_roles)
|
||||
|
||||
# Define ceilometer-releated parameters
|
||||
if !$ceilometer_hash['alarm_history_time_to_live'] { $ceilometer_hash['alarm_history_time_to_live'] = '604800'}
|
||||
|
@ -378,21 +389,21 @@ if !$ceilometer_hash['http_timeout'] { $ceilometer_hash['http_timeout'] = '600'
|
|||
|
||||
# Define database-related variables:
|
||||
# todo: use special node-roles instead controllers in the future
|
||||
$database_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
|
||||
$database_nodes = $controller_nodes
|
||||
|
||||
# Define Nova-API variables:
|
||||
# todo: use special node-roles instead controllers in the future
|
||||
$nova_api_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
|
||||
$nova_api_nodes = $controller_nodes
|
||||
|
||||
# Define mongo-related variables
|
||||
$mongo_roles = ['primary-mongo', 'mongo']
|
||||
|
||||
# Define neutron-related variables:
|
||||
# todo: use special node-roles instead controllers in the future
|
||||
$neutron_nodes = get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller'])
|
||||
$neutron_nodes = $controller_nodes
|
||||
|
||||
#Define Ironic-related variables:
|
||||
$ironic_api_nodes = $controllers_hash
|
||||
$ironic_api_nodes = $controller_nodes
|
||||
|
||||
# Change nova_hash to add vnc port to it
|
||||
# TODO(sbog): change this when we will get rid of global hashes
|
||||
|
|
|
@ -3,9 +3,8 @@ notice('MODULAR: openstack-haproxy-ceilometer.pp')
|
|||
$ceilometer_hash = hiera_hash('ceilometer',{})
|
||||
# NOT enabled by default
|
||||
$use_ceilometer = pick($ceilometer_hash['enabled'], false)
|
||||
$public_ssl_hash = hiera('public_ssl')
|
||||
$public_ssl_hash = hiera_hash('public_ssl', {})
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
$ceilometer_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('ceilometer_nodes'), 'ceilometer/api')
|
||||
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'ceilometer', 'public', 'usage', false)
|
||||
$public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'ceilometer', 'public', 'path', [''])
|
||||
|
@ -16,10 +15,11 @@ $internal_ssl_path = get_ssl_property($ssl_hash, {}, 'ceilometer', 'intern
|
|||
$external_lb = hiera('external_lb', false)
|
||||
|
||||
if ($use_ceilometer and !$external_lb) {
|
||||
$server_names = hiera_array('ceilometer_names', keys($ceilometer_address_map))
|
||||
$ipaddresses = hiera_array('ceilometer_ipaddresses', values($ceilometer_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
$internal_virtual_ip = hiera('management_vip')
|
||||
$ceilometer_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('ceilometer_nodes'), 'ceilometer/api')
|
||||
$server_names = hiera_array('ceilometer_names', keys($ceilometer_address_map))
|
||||
$ipaddresses = hiera_array('ceilometer_ipaddresses', values($ceilometer_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
$internal_virtual_ip = hiera('management_vip')
|
||||
|
||||
# configure ceilometer ha proxy
|
||||
class { '::openstack::ha::ceilometer':
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
notice('MODULAR: openstack-haproxy-cinder.pp')
|
||||
|
||||
$network_metadata = hiera_hash('network_metadata')
|
||||
$cinder_hash = hiera_hash('cinder_hash', {})
|
||||
# enabled by default
|
||||
$use_cinder = pick($cinder_hash['enabled'], true)
|
||||
$public_ssl_hash = hiera('public_ssl')
|
||||
$public_ssl_hash = hiera_hash('public_ssl', {})
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'cinder', 'public', 'usage', false)
|
||||
|
@ -13,10 +12,10 @@ $public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'cinder', 'p
|
|||
$internal_ssl = get_ssl_property($ssl_hash, {}, 'cinder', 'internal', 'usage', false)
|
||||
$internal_ssl_path = get_ssl_property($ssl_hash, {}, 'cinder', 'internal', 'path', [''])
|
||||
|
||||
$cinder_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('cinder_nodes'), 'cinder/api')
|
||||
$external_lb = hiera('external_lb', false)
|
||||
|
||||
if ($use_cinder and !$external_lb) {
|
||||
$cinder_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('cinder_nodes'), 'cinder/api')
|
||||
$server_names = hiera_array('cinder_names', keys($cinder_address_map))
|
||||
$ipaddresses = hiera_array('cinder_ipaddresses', values($cinder_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
notice('MODULAR: openstack-haproxy-glance.pp')
|
||||
|
||||
$network_metadata = hiera_hash('network_metadata')
|
||||
$glance_hash = hiera_hash('glance', {})
|
||||
# enabled by default
|
||||
$use_glance = pick($glance_hash['enabled'], true)
|
||||
$public_ssl_hash = hiera('public_ssl')
|
||||
$public_ssl_hash = hiera_hash('public_ssl', {})
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'glance', 'public', 'usage', false)
|
||||
|
@ -13,17 +12,16 @@ $public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'glance', 'pu
|
|||
$internal_ssl = get_ssl_property($ssl_hash, {}, 'glance', 'internal', 'usage', false)
|
||||
$internal_ssl_path = get_ssl_property($ssl_hash, {}, 'glance', 'internal', 'path', [''])
|
||||
|
||||
#todo(sv): change to 'glance' as soon as glance as node-role was ready
|
||||
$glances_address_map = get_node_to_ipaddr_map_by_network_role(get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller']), 'glance/api')
|
||||
|
||||
$external_lb = hiera('external_lb', false)
|
||||
$external_lb = hiera('external_lb', false)
|
||||
|
||||
if ($use_glance and !$external_lb) {
|
||||
$server_names = hiera_array('glance_names', keys($glances_address_map))
|
||||
$ipaddresses = hiera_array('glance_ipaddresses', values($glances_address_map))
|
||||
$glance_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('glance_nodes'), 'glance/api')
|
||||
$server_names = hiera_array('glance_names', keys($glance_address_map))
|
||||
$ipaddresses = hiera_array('glance_ipaddresses', values($glance_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
$internal_virtual_ip = hiera('management_vip')
|
||||
|
||||
# configure glance ha proxy
|
||||
class { '::openstack::ha::glance':
|
||||
internal_virtual_ip => $internal_virtual_ip,
|
||||
ipaddresses => $ipaddresses,
|
||||
|
|
|
@ -3,8 +3,8 @@ notice('MODULAR: openstack-haproxy-heat.pp')
|
|||
$heat_hash = hiera_hash('heat', {})
|
||||
# enabled by default
|
||||
$use_heat = pick($heat_hash['enabled'], true)
|
||||
$public_ssl_hash = hiera('public_ssl')
|
||||
$ssl_hash = hiera('use_ssl', {})
|
||||
$public_ssl_hash = hiera_hash('public_ssl', {})
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'heat', 'public', 'usage', false)
|
||||
$public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'heat', 'public', 'path', [''])
|
||||
|
@ -12,18 +12,16 @@ $public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'heat', 'publ
|
|||
$internal_ssl = get_ssl_property($ssl_hash, {}, 'heat', 'internal', 'usage', false)
|
||||
$internal_ssl_path = get_ssl_property($ssl_hash, {}, 'heat', 'internal', 'path', [''])
|
||||
|
||||
$network_metadata = hiera_hash('network_metadata')
|
||||
$heat_address_map = get_node_to_ipaddr_map_by_network_role(get_nodes_hash_by_roles($network_metadata, hiera('heat_roles')), 'heat/api')
|
||||
|
||||
$external_lb = hiera('external_lb', false)
|
||||
|
||||
if ($use_heat and !$external_lb) {
|
||||
$server_names = hiera_array('heat_names',keys($heat_address_map))
|
||||
$heat_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('heat_nodes'), 'heat/api')
|
||||
$server_names = hiera_array('heat_names', keys($heat_address_map))
|
||||
$ipaddresses = hiera_array('heat_ipaddresses', values($heat_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
$internal_virtual_ip = hiera('management_vip')
|
||||
|
||||
# configure heat ha proxy
|
||||
# configure heat ha proxy
|
||||
class { '::openstack::ha::heat':
|
||||
internal_virtual_ip => $internal_virtual_ip,
|
||||
ipaddresses => $ipaddresses,
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
notice('MODULAR: openstack-haproxy-horizon.pp')
|
||||
|
||||
$network_metadata = hiera_hash('network_metadata')
|
||||
$horizon_hash = hiera_hash('horizon', {})
|
||||
# enabled by default
|
||||
$use_horizon = pick($horizon_hash['enabled'], true)
|
||||
$public_ssl_hash = hiera('public_ssl')
|
||||
$public_ssl_hash = hiera_hash('public_ssl', {})
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'horizon', 'public', 'usage', false)
|
||||
$public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'horizon', 'public', 'path', [''])
|
||||
|
||||
$horizon_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('horizon_nodes'), 'horizon')
|
||||
$external_lb = hiera('external_lb', false)
|
||||
|
||||
if ($use_horizon and !$external_lb) {
|
||||
$horizon_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('horizon_nodes'), 'horizon')
|
||||
$server_names = hiera_array('horizon_names', keys($horizon_address_map))
|
||||
$ipaddresses = hiera_array('horizon_ipaddresses', values($horizon_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
notice('MODULAR: openstack-haproxy-ironic.pp')
|
||||
|
||||
$network_metadata = hiera_hash('network_metadata')
|
||||
$public_ssl_hash = hiera('public_ssl')
|
||||
$public_ssl_hash = hiera_hash('public_ssl', {})
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
$ironic_hash = hiera_hash('ironic', {})
|
||||
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'ironic', 'public', 'usage', false)
|
||||
$public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'ironic', 'public', 'path', [''])
|
||||
|
@ -14,10 +13,12 @@ $server_names = hiera_array('ironic_server_names', keys($ironic_address_
|
|||
$ipaddresses = hiera_array('ironic_ipaddresses', values($ironic_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
$internal_virtual_ip = hiera('management_vip')
|
||||
|
||||
$baremetal_virtual_ip = $network_metadata['vips']['baremetal']['ipaddr']
|
||||
$external_lb = hiera('external_lb', false)
|
||||
|
||||
if !$external_lb {
|
||||
# configure ironic ha proxy
|
||||
class { '::openstack::ha::ironic':
|
||||
internal_virtual_ip => $internal_virtual_ip,
|
||||
ipaddresses => $ipaddresses,
|
||||
|
|
|
@ -1,34 +1,28 @@
|
|||
notice('MODULAR: openstack-haproxy-keystone.pp')
|
||||
|
||||
$network_metadata = hiera_hash('network_metadata')
|
||||
$keystone_hash = hiera_hash('keystone', {})
|
||||
$keystone_hash = hiera_hash('keystone', {})
|
||||
# enabled by default
|
||||
$use_keystone = pick($keystone_hash['enabled'], true)
|
||||
$public_ssl_hash = hiera('public_ssl')
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
$use_keystone = pick($keystone_hash['enabled'], true)
|
||||
$public_ssl_hash = hiera_hash('public_ssl', {})
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'keystone', 'public', 'usage', false)
|
||||
$public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'keystone', 'public', 'path', [''])
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'keystone', 'public', 'usage', false)
|
||||
$public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'keystone', 'public', 'path', [''])
|
||||
|
||||
$internal_ssl = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'usage', false)
|
||||
$internal_ssl_path = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'path', [''])
|
||||
$internal_ssl = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'usage', false)
|
||||
$internal_ssl_path = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'path', [''])
|
||||
|
||||
$admin_ssl = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'usage', false)
|
||||
$admin_ssl_path = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'path', [''])
|
||||
$admin_ssl = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'usage', false)
|
||||
$admin_ssl_path = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'path', [''])
|
||||
|
||||
#todo(sv): change to 'keystone' as soon as keystone as node-role was ready
|
||||
$keystones_address_map = get_node_to_ipaddr_map_by_network_role(get_nodes_hash_by_roles($network_metadata, ['primary-controller', 'controller']), 'keystone/api')
|
||||
|
||||
$external_lb = hiera('external_lb', false)
|
||||
$external_lb = hiera('external_lb', false)
|
||||
|
||||
if ($use_keystone and !$external_lb) {
|
||||
$server_names = pick(hiera_array('keystone_names', undef),
|
||||
keys($keystones_address_map))
|
||||
$ipaddresses = pick(hiera_array('keystone_ipaddresses', undef),
|
||||
values($keystones_address_map))
|
||||
$public_virtual_ip = pick(hiera('public_service_endpoint', undef), hiera('public_vip'))
|
||||
$internal_virtual_ip = pick(hiera('service_endpoint', undef), hiera('management_vip'))
|
||||
|
||||
$keystone_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('keystone_nodes'), 'keystone/api')
|
||||
$server_names = hiera_array('keystone_names', keys($keystone_address_map))
|
||||
$ipaddresses = hiera_array('keystone_ipaddresses', values($keystone_address_map))
|
||||
$public_virtual_ip = pick(hiera('public_service_endpoint', undef), hiera('public_vip'))
|
||||
$internal_virtual_ip = pick(hiera('service_endpoint', undef), hiera('management_vip'))
|
||||
|
||||
# configure keystone ha proxy
|
||||
class { '::openstack::ha::keystone':
|
||||
|
|
|
@ -5,19 +5,20 @@ $murano_cfapi_hash = hiera_hash('murano-cfapi',{})
|
|||
# NOT enabled by default
|
||||
$use_murano = pick($murano_hash['enabled'], false)
|
||||
$use_murano_cfapi = pick($murano_cfapi_hash['enabled'], false)
|
||||
$public_ssl_hash = hiera('public_ssl')
|
||||
$public_ssl_hash = hiera_hash('public_ssl', {})
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'murano', 'public', 'usage', false)
|
||||
$public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'murano', 'public', 'path', [''])
|
||||
|
||||
$internal_ssl = get_ssl_property($ssl_hash, {}, 'murano', 'internal', 'usage', false)
|
||||
$internal_ssl_path = get_ssl_property($ssl_hash, {}, 'murano', 'internal', 'path', [''])
|
||||
|
||||
$network_metadata = hiera_hash('network_metadata')
|
||||
$murano_address_map = get_node_to_ipaddr_map_by_network_role(get_nodes_hash_by_roles($network_metadata, hiera('murano_roles')), 'murano/api')
|
||||
$external_lb = hiera('external_lb', false)
|
||||
|
||||
if ($use_murano and !$external_lb) {
|
||||
$server_names = hiera_array('murano_names',keys($murano_address_map))
|
||||
$murano_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('murano_nodes'), 'murano/api')
|
||||
$server_names = hiera_array('murano_names', keys($murano_address_map))
|
||||
$ipaddresses = hiera_array('murano_ipaddresses', values($murano_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
$internal_virtual_ip = hiera('management_vip')
|
||||
|
|
|
@ -1,26 +1,22 @@
|
|||
notice('MODULAR: openstack-haproxy-mysqld.pp')
|
||||
|
||||
$network_metadata = hiera_hash('network_metadata')
|
||||
$mysql_hash = hiera_hash('mysql', {})
|
||||
$mysql_hash = hiera_hash('mysql', {})
|
||||
# enabled by default
|
||||
$use_mysql = pick($mysql_hash['enabled'], true)
|
||||
$use_mysql = pick($mysql_hash['enabled'], true)
|
||||
|
||||
$custom_mysql_setup_class = hiera('custom_mysql_setup_class', 'galera')
|
||||
$public_ssl_hash = hiera('public_ssl')
|
||||
|
||||
$database_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('database_nodes'), 'mgmt/database')
|
||||
|
||||
$external_lb = hiera('external_lb', false)
|
||||
$external_lb = hiera('external_lb', false)
|
||||
|
||||
# only do this if mysql is enabled and we are using one of the galera/percona classes
|
||||
if !$external_lb and $use_mysql and ($custom_mysql_setup_class in ['galera', 'percona', 'percona_packages']) {
|
||||
$server_names = hiera_array('mysqld_names', keys($database_address_map))
|
||||
$ipaddresses = hiera_array('mysqld_ipaddresses', values($database_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
$internal_virtual_ip = pick(hiera('database_vip', undef), hiera('management_vip'))
|
||||
|
||||
$primary_controller = hiera('primary_controller')
|
||||
$database_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('database_nodes'), 'mgmt/database')
|
||||
$server_names = hiera_array('mysqld_names', keys($database_address_map))
|
||||
$ipaddresses = hiera_array('mysqld_ipaddresses', values($database_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
$internal_virtual_ip = pick(hiera('database_vip', undef), hiera('management_vip'))
|
||||
|
||||
$primary_controller = hiera('primary_controller')
|
||||
|
||||
# configure mysql ha proxy
|
||||
class { '::openstack::ha::mysqld':
|
||||
|
|
|
@ -2,7 +2,7 @@ notice('MODULAR: openstack-haproxy-neutron.pp')
|
|||
|
||||
# NOT enabled by default
|
||||
$use_neutron = hiera('use_neutron', false)
|
||||
$public_ssl_hash = hiera('public_ssl')
|
||||
$public_ssl_hash = hiera_hash('public_ssl', {})
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'neutron', 'public', 'usage', false)
|
||||
|
@ -11,11 +11,10 @@ $public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'neutron',
|
|||
$internal_ssl = get_ssl_property($ssl_hash, {}, 'neutron', 'internal', 'usage', false)
|
||||
$internal_ssl_path = get_ssl_property($ssl_hash, {}, 'neutron', 'internal', 'path', [''])
|
||||
|
||||
$neutron_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('neutron_nodes'), 'neutron/api')
|
||||
|
||||
$external_lb = hiera('external_lb', false)
|
||||
|
||||
if ($use_neutron and !$external_lb) {
|
||||
$neutron_address_map = get_node_to_ipaddr_map_by_network_role(hiera_hash('neutron_nodes'), 'neutron/api')
|
||||
$server_names = hiera_array('neutron_names', keys($neutron_address_map))
|
||||
$ipaddresses = hiera_array('neutron_ipaddresses', values($neutron_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
|
|
|
@ -1,27 +1,25 @@
|
|||
notice('MODULAR: openstack-haproxy-nova.pp')
|
||||
|
||||
$nova_hash = hiera_hash('nova', {})
|
||||
$nova_hash = hiera_hash('nova', {})
|
||||
# enabled by default
|
||||
$use_nova = pick($nova_hash['enabled'], true)
|
||||
$public_ssl_hash = hiera('public_ssl')
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
$use_nova = pick($nova_hash['enabled'], true)
|
||||
$public_ssl_hash = hiera_hash('public_ssl', {})
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'nova', 'public', 'usage', false)
|
||||
$public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'nova', 'public', 'path', [''])
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'nova', 'public', 'usage', false)
|
||||
$public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'nova', 'public', 'path', [''])
|
||||
|
||||
$internal_ssl = get_ssl_property($ssl_hash, {}, 'nova', 'internal', 'usage', false)
|
||||
$internal_ssl_path = get_ssl_property($ssl_hash, {}, 'nova', 'internal', 'path', [''])
|
||||
$internal_ssl = get_ssl_property($ssl_hash, {}, 'nova', 'internal', 'usage', false)
|
||||
$internal_ssl_path = get_ssl_property($ssl_hash, {}, 'nova', 'internal', 'path', [''])
|
||||
|
||||
$nova_api_address_map = get_node_to_ipaddr_map_by_network_role(hiera('nova_api_nodes'), 'nova/api')
|
||||
|
||||
$external_lb = hiera('external_lb', false)
|
||||
$external_lb = hiera('external_lb', false)
|
||||
|
||||
if ($use_nova and !$external_lb) {
|
||||
$server_names = hiera_array('nova_names', keys($nova_api_address_map))
|
||||
$ipaddresses = hiera_array('nova_ipaddresses', values($nova_api_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
$internal_virtual_ip = hiera('management_vip')
|
||||
|
||||
$nova_api_address_map = get_node_to_ipaddr_map_by_network_role(hiera('nova_api_nodes'), 'nova/api')
|
||||
$server_names = hiera_array('nova_names', keys($nova_api_address_map))
|
||||
$ipaddresses = hiera_array('nova_ipaddresses', values($nova_api_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
$internal_virtual_ip = hiera('management_vip')
|
||||
|
||||
# configure nova ha proxy
|
||||
class { '::openstack::ha::nova':
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
notice('MODULAR: openstack-haproxy-radosgw.pp')
|
||||
|
||||
$network_metadata = hiera_hash('network_metadata')
|
||||
$storage_hash = hiera_hash('storage', {})
|
||||
$public_ssl_hash = hiera('public_ssl')
|
||||
$public_ssl_hash = hiera_hash('public_ssl', {})
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'radosgw', 'public', 'usage', false)
|
||||
$public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'radosgw', 'public', 'path', [''])
|
||||
$ironic_hash = hiera_hash('ironic', {})
|
||||
|
||||
$external_lb = hiera('external_lb', false)
|
||||
|
||||
if !$external_lb {
|
||||
|
@ -29,7 +28,10 @@ if !$external_lb {
|
|||
$public_virtual_ip = hiera('public_vip')
|
||||
$internal_virtual_ip = hiera('management_vip')
|
||||
|
||||
$ironic_hash = hiera_hash('ironic', {})
|
||||
|
||||
if $ironic_hash['enabled'] {
|
||||
$network_metadata = hiera_hash('network_metadata')
|
||||
$baremetal_virtual_ip = $network_metadata['vips']['baremetal']['ipaddr']
|
||||
}
|
||||
|
||||
|
|
|
@ -1,23 +1,22 @@
|
|||
notice('MODULAR: openstack-haproxy-sahara.pp')
|
||||
|
||||
$sahara_hash = hiera_hash('sahara_hash',{})
|
||||
$sahara_hash = hiera_hash('sahara_hash',{})
|
||||
# NOT enabled by default
|
||||
$use_sahara = pick($sahara_hash['enabled'], false)
|
||||
$public_ssl_hash = hiera('public_ssl')
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
$use_sahara = pick($sahara_hash['enabled'], false)
|
||||
$public_ssl_hash = hiera_hash('public_ssl', {})
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'sahara', 'public', 'usage', false)
|
||||
$public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'sahara', 'public', 'path', [''])
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'sahara', 'public', 'usage', false)
|
||||
$public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'sahara', 'public', 'path', [''])
|
||||
|
||||
$internal_ssl = get_ssl_property($ssl_hash, {}, 'sahara', 'internal', 'usage', false)
|
||||
$internal_ssl_path = get_ssl_property($ssl_hash, {}, 'sahara', 'internal', 'path', [''])
|
||||
$internal_ssl = get_ssl_property($ssl_hash, {}, 'sahara', 'internal', 'usage', false)
|
||||
$internal_ssl_path = get_ssl_property($ssl_hash, {}, 'sahara', 'internal', 'path', [''])
|
||||
|
||||
$network_metadata = hiera_hash('network_metadata')
|
||||
$sahara_address_map = get_node_to_ipaddr_map_by_network_role(get_nodes_hash_by_roles($network_metadata, hiera('sahara_roles')), 'sahara/api')
|
||||
$external_lb = hiera('external_lb', false)
|
||||
$external_lb = hiera('external_lb', false)
|
||||
|
||||
if ($use_sahara and !$external_lb) {
|
||||
$server_names = hiera_array('sahara_names',keys($sahara_address_map))
|
||||
$sahara_address_map = get_node_to_ipaddr_map_by_network_role(hiera('sahara_nodes'), 'sahara/api')
|
||||
$server_names = hiera_array('sahara_names', keys($sahara_address_map))
|
||||
$ipaddresses = hiera_array('sahara_ipaddresses', values($sahara_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
$internal_virtual_ip = hiera('management_vip')
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
notice('MODULAR: openstack-haproxy-swift.pp')
|
||||
|
||||
$network_metadata = hiera_hash('network_metadata')
|
||||
$storage_hash = hiera_hash('storage', {})
|
||||
$swift_proxies = hiera_hash('swift_proxies', undef)
|
||||
$public_ssl_hash = hiera('public_ssl')
|
||||
$public_ssl_hash = hiera_hash('public_ssl', {})
|
||||
$ssl_hash = hiera_hash('use_ssl', {})
|
||||
|
||||
$public_ssl = get_ssl_property($ssl_hash, $public_ssl_hash, 'swift', 'public', 'usage', false)
|
||||
|
@ -12,8 +11,6 @@ $public_ssl_path = get_ssl_property($ssl_hash, $public_ssl_hash, 'swift', 'pub
|
|||
$internal_ssl = get_ssl_property($ssl_hash, {}, 'swift', 'internal', 'usage', false)
|
||||
$internal_ssl_path = get_ssl_property($ssl_hash, {}, 'swift', 'internal', 'path', [''])
|
||||
|
||||
$ironic_hash = hiera_hash('ironic', {})
|
||||
|
||||
$external_lb = hiera('external_lb', false)
|
||||
|
||||
if !($storage_hash['images_ceph'] and $storage_hash['objects_ceph']) and !$storage_hash['images_vcenter'] {
|
||||
|
@ -22,16 +19,17 @@ if !($storage_hash['images_ceph'] and $storage_hash['objects_ceph']) and !$stora
|
|||
$use_swift = false
|
||||
}
|
||||
|
||||
$swift_proxies_address_map = get_node_to_ipaddr_map_by_network_role($swift_proxies, 'swift/api')
|
||||
|
||||
if ($use_swift and !$external_lb) {
|
||||
$swift_proxy_address_map = get_node_to_ipaddr_map_by_network_role($swift_proxies, 'swift/api')
|
||||
$server_names = hiera_array('swift_server_names', keys($swift_proxy_address_map))
|
||||
$ipaddresses = hiera_array('swift_ipaddresses', values($swift_proxy_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
$internal_virtual_ip = hiera('management_vip')
|
||||
|
||||
$server_names = hiera_array('swift_server_names', keys($swift_proxies_address_map))
|
||||
$ipaddresses = hiera_array('swift_ipaddresses', values($swift_proxies_address_map))
|
||||
$public_virtual_ip = hiera('public_vip')
|
||||
$internal_virtual_ip = hiera('management_vip')
|
||||
$ironic_hash = hiera_hash('ironic', {})
|
||||
|
||||
if $ironic_hash['enabled'] {
|
||||
$network_metadata = hiera_hash('network_metadata')
|
||||
$baremetal_virtual_ip = $network_metadata['vips']['baremetal']['ipaddr']
|
||||
}
|
||||
|
||||
|
|
|
@ -26,12 +26,15 @@
|
|||
<% globals.store "glance_backend", @glance_backend -%>
|
||||
<% globals.store "glance_hash", @glance_hash -%>
|
||||
<% globals.store "glance_known_stores", @glance_known_stores -%>
|
||||
<% globals.store "glance_nodes", @glance_nodes -%>
|
||||
<% globals.store "heat_hash", @heat_hash -%>
|
||||
<% globals.store "heat_nodes", @heat_nodes -%>
|
||||
<% globals.store "heat_roles", @heat_roles -%>
|
||||
<% globals.store "horizon_nodes", @horizon_nodes -%>
|
||||
<% globals.store "node_name", @node_name -%>
|
||||
<% globals.store "idle_timeout", @idle_timeout -%>
|
||||
<% globals.store "keystone_hash", @keystone_hash -%>
|
||||
<% globals.store "keystone_nodes", @keystone_nodes -%>
|
||||
<% globals.store "manage_volumes", @manage_volumes -%>
|
||||
<% globals.store "management_network_range", @management_network_range -%>
|
||||
<% globals.store "master_ip", @master_ip -%>
|
||||
|
@ -43,6 +46,7 @@
|
|||
<% globals.store "mongo_roles", @mongo_roles -%>
|
||||
<% globals.store "multi_host", @multi_host -%>
|
||||
<% globals.store "murano_hash", @murano_hash -%>
|
||||
<% globals.store "murano_nodes", @murano_nodes -%>
|
||||
<% globals.store "murano_roles", @murano_roles -%>
|
||||
<% globals.store "mysql_hash", @mysql_hash -%>
|
||||
<% globals.store "network_config", @network_config -%>
|
||||
|
@ -71,6 +75,7 @@
|
|||
<% globals.store "rabbit_hash", @rabbit_hash -%>
|
||||
<% globals.store "roles", @roles -%>
|
||||
<% globals.store "sahara_hash", @sahara_hash -%>
|
||||
<% globals.store "sahara_nodes", @sahara_nodes -%>
|
||||
<% globals.store "sahara_roles", @sahara_roles -%>
|
||||
<% globals.store "sql_connection", @sql_connection -%>
|
||||
<% globals.store "storage_hash", @storage_hash -%>
|
||||
|
|
|
@ -4,6 +4,21 @@ manifest = 'openstack-haproxy/openstack-haproxy-ceilometer.pp'
|
|||
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
|
||||
ceilometer_nodes = Noop.hiera_hash('ceilometer_nodes')
|
||||
|
||||
let(:ceilometer_address_map) do
|
||||
Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', ceilometer_nodes, 'heat/api'
|
||||
end
|
||||
|
||||
let(:ipaddresses) do
|
||||
ceilometer_address_map.values
|
||||
end
|
||||
|
||||
let(:server_names) do
|
||||
ceilometer_address_map.keys
|
||||
end
|
||||
|
||||
use_ceilometer = Noop.hiera_structure('ceilometer/enabled', false)
|
||||
|
||||
if use_ceilometer and !Noop.hiera('external_lb', false)
|
||||
|
@ -11,6 +26,8 @@ describe manifest do
|
|||
public_ssl_ceilometer = Noop.hiera_structure('public_ssl/services', false)
|
||||
should contain_openstack__ha__haproxy_service('ceilometer').with(
|
||||
'order' => '140',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 8777,
|
||||
'public' => true,
|
||||
'public_ssl' => public_ssl_ceilometer,
|
||||
|
|
|
@ -3,14 +3,31 @@ require 'shared-examples'
|
|||
manifest = 'openstack-haproxy/openstack-haproxy-cinder.pp'
|
||||
|
||||
describe manifest do
|
||||
use_cinder = Noop.hiera_structure('cinder/enabled', true)
|
||||
|
||||
shared_examples 'catalog' do
|
||||
|
||||
cinder_nodes = Noop.hiera_hash('cinder_nodes')
|
||||
|
||||
let(:cinder_address_map) do
|
||||
Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', cinder_nodes, 'heat/api'
|
||||
end
|
||||
|
||||
let(:ipaddresses) do
|
||||
cinder_address_map.values
|
||||
end
|
||||
|
||||
let(:server_names) do
|
||||
cinder_address_map.keys
|
||||
end
|
||||
|
||||
use_cinder = Noop.hiera_structure('cinder/enabled', true)
|
||||
|
||||
if use_cinder and !Noop.hiera('external_lb', false)
|
||||
it "should properly configure cinder haproxy based on ssl" do
|
||||
public_ssl_cinder = Noop.hiera_structure('public_ssl/services', false)
|
||||
should contain_openstack__ha__haproxy_service('cinder-api').with(
|
||||
'order' => '070',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 8776,
|
||||
'public' => true,
|
||||
'public_ssl' => public_ssl_cinder,
|
||||
|
@ -26,4 +43,3 @@ describe manifest do
|
|||
end
|
||||
test_ubuntu_and_centos manifest
|
||||
end
|
||||
|
||||
|
|
|
@ -4,11 +4,8 @@ manifest = 'openstack-haproxy/openstack-haproxy-glance.pp'
|
|||
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
network_metadata = Noop.hiera('network_metadata')
|
||||
|
||||
let(:glance_nodes) do
|
||||
Noop.puppet_function 'get_nodes_hash_by_roles', network_metadata, ['primary-controller', 'controller']
|
||||
end
|
||||
glance_nodes = Noop.hiera_hash('glance_nodes')
|
||||
|
||||
let(:glance_address_map) do
|
||||
Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', glance_nodes, 'glance/api'
|
||||
|
|
|
@ -4,12 +4,8 @@ manifest = 'openstack-haproxy/openstack-haproxy-heat.pp'
|
|||
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
network_metadata = Noop.hiera('network_metadata')
|
||||
heat_roles = Noop.hiera('heat_roles')
|
||||
|
||||
let(:heat_nodes) do
|
||||
Noop.puppet_function 'get_nodes_hash_by_roles', network_metadata, heat_roles
|
||||
end
|
||||
heat_nodes = Noop.hiera_hash('heat_nodes')
|
||||
|
||||
let(:heat_address_map) do
|
||||
Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', heat_nodes, 'heat/api'
|
||||
|
@ -26,13 +22,13 @@ describe manifest do
|
|||
public_virtual_ip = Noop.hiera('public_vip')
|
||||
internal_virtual_ip = Noop.hiera('management_vip')
|
||||
public_ssl = Noop.hiera_structure('public_ssl/services')
|
||||
|
||||
unless Noop.hiera('external_lb', false)
|
||||
it 'should configure heat haproxy' do
|
||||
should contain_openstack__ha__haproxy_service('heat-api').with(
|
||||
'order' => '160',
|
||||
'listen_port' => 8004,
|
||||
'require_service' => 'heat-api',
|
||||
|
||||
# common parameters
|
||||
'internal_virtual_ip' => internal_virtual_ip,
|
||||
'ipaddresses' => ipaddresses,
|
||||
|
@ -65,4 +61,3 @@ describe manifest do
|
|||
end
|
||||
test_ubuntu_and_centos manifest
|
||||
end
|
||||
|
||||
|
|
|
@ -4,6 +4,21 @@ manifest = 'openstack-haproxy/openstack-haproxy-horizon.pp'
|
|||
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
|
||||
horizon_nodes = Noop.hiera_hash('horizon_nodes')
|
||||
|
||||
let(:horizon_address_map) do
|
||||
Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', horizon_nodes, 'heat/api'
|
||||
end
|
||||
|
||||
let(:ipaddresses) do
|
||||
horizon_address_map.values
|
||||
end
|
||||
|
||||
let(:server_names) do
|
||||
horizon_address_map.keys
|
||||
end
|
||||
|
||||
unless Noop.hiera('external_lb', false)
|
||||
it "should properly configure horizon haproxy based on ssl" do
|
||||
public_ssl_horizon = Noop.hiera_structure('public_ssl/horizon', false)
|
||||
|
@ -19,6 +34,8 @@ describe manifest do
|
|||
should_not contain_haproxy__balancermember('horizon')
|
||||
should contain_openstack__ha__haproxy_service('horizon-ssl').with(
|
||||
'order' => '017',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 443,
|
||||
'balancermember_port' => 80,
|
||||
'public_ssl' => public_ssl_horizon,
|
||||
|
@ -37,6 +54,8 @@ describe manifest do
|
|||
else
|
||||
# http horizon only
|
||||
should contain_openstack__ha__haproxy_service('horizon').with(
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'haproxy_config_options' => {
|
||||
'option' => ['forwardfor', 'httpchk', 'httpclose', 'httplog'],
|
||||
'stick-table' => 'type ip size 200k expire 30m',
|
||||
|
@ -57,4 +76,3 @@ describe manifest do
|
|||
|
||||
test_ubuntu_and_centos manifest
|
||||
end
|
||||
|
||||
|
|
|
@ -6,6 +6,21 @@ ironic_enabled = Noop.hiera_structure 'ironic/enabled'
|
|||
if ironic_enabled
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
|
||||
ironic_api_nodes = Noop.hiera_hash('ironic_api_nodes')
|
||||
|
||||
let(:ironic_address_map) do
|
||||
Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', ironic_api_nodes, 'ironic/api'
|
||||
end
|
||||
|
||||
let(:ipaddresses) do
|
||||
ironic_address_map.values
|
||||
end
|
||||
|
||||
let(:server_names) do
|
||||
ironic_address_map.keys
|
||||
end
|
||||
|
||||
use_ironic = Noop.hiera_structure('ironic/enabled', true)
|
||||
baremetal_virtual_ip = Noop.hiera_structure 'network_metadata/vips/baremetal/ipaddr'
|
||||
public_ssl_ironic = Noop.hiera_structure('public_ssl/services', false)
|
||||
|
@ -14,6 +29,8 @@ if ironic_enabled
|
|||
it "should properly configure ironic haproxy based on ssl" do
|
||||
should contain_openstack__ha__haproxy_service('ironic').with(
|
||||
'order' => '180',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 6385,
|
||||
'public' => true,
|
||||
'public_ssl' => public_ssl_ironic,
|
||||
|
@ -27,6 +44,8 @@ if ironic_enabled
|
|||
it "should properly configure ironic haproxy on baremetal vip" do
|
||||
should contain_openstack__ha__haproxy_service('ironic-baremetal').with(
|
||||
'order' => '185',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 6385,
|
||||
'public_virtual_ip' => false,
|
||||
'internal_virtual_ip' => baremetal_virtual_ip,
|
||||
|
|
|
@ -4,6 +4,21 @@ manifest = 'openstack-haproxy/openstack-haproxy-keystone.pp'
|
|||
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
|
||||
keystone_nodes = Noop.hiera_hash('keystone_nodes')
|
||||
|
||||
let(:keystone_address_map) do
|
||||
Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', keystone_nodes, 'heat/api'
|
||||
end
|
||||
|
||||
let(:ipaddresses) do
|
||||
keystone_address_map.values
|
||||
end
|
||||
|
||||
let(:server_names) do
|
||||
keystone_address_map.keys
|
||||
end
|
||||
|
||||
use_keystone = Noop.hiera_structure('keystone/enabled', true)
|
||||
|
||||
if use_keystone and !Noop.hiera('external_lb', false)
|
||||
|
@ -11,6 +26,8 @@ describe manifest do
|
|||
public_ssl_keystone = Noop.hiera_structure('public_ssl/services', false)
|
||||
should contain_openstack__ha__haproxy_service('keystone-1').with(
|
||||
'order' => '020',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 5000,
|
||||
'public' => true,
|
||||
'public_ssl' => public_ssl_keystone,
|
||||
|
@ -24,6 +41,8 @@ describe manifest do
|
|||
public_ssl_keystone = Noop.hiera_structure('public_ssl/services', false)
|
||||
should contain_openstack__ha__haproxy_service('keystone-2').with(
|
||||
'order' => '030',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 35357,
|
||||
'public' => false,
|
||||
'haproxy_config_options' => {
|
||||
|
|
|
@ -4,6 +4,21 @@ manifest = 'openstack-haproxy/openstack-haproxy-murano.pp'
|
|||
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
|
||||
murano_nodes = Noop.hiera_hash('murano_nodes')
|
||||
|
||||
let(:murano_address_map) do
|
||||
Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', murano_nodes, 'heat/api'
|
||||
end
|
||||
|
||||
let(:ipaddresses) do
|
||||
murano_address_map.values
|
||||
end
|
||||
|
||||
let(:server_names) do
|
||||
murano_address_map.keys
|
||||
end
|
||||
|
||||
use_murano = Noop.hiera_structure('murano/enabled', false)
|
||||
use_cfapi_murano = Noop.hiera_structure('murano-cfapi/enabled', false)
|
||||
|
||||
|
@ -12,6 +27,8 @@ describe manifest do
|
|||
public_ssl_murano = Noop.hiera_structure('public_ssl/services', false)
|
||||
should contain_openstack__ha__haproxy_service('murano-api').with(
|
||||
'order' => '190',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 8082,
|
||||
'public' => true,
|
||||
'public_ssl' => public_ssl_murano,
|
||||
|
@ -27,6 +44,8 @@ describe manifest do
|
|||
public_ssl_murano = Noop.hiera_structure('public_ssl/services', false)
|
||||
should contain_openstack__ha__haproxy_service('murano-cfapi').with(
|
||||
'order' => '192',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 8083,
|
||||
'public' => true,
|
||||
'public_ssl' => public_ssl_murano,
|
||||
|
@ -42,6 +61,8 @@ describe manifest do
|
|||
public_ssl_murano = Noop.hiera_structure('public_ssl/services', false)
|
||||
should contain_openstack__ha__haproxy_service('murano_rabbitmq').with(
|
||||
'order' => '191',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 55572,
|
||||
'internal' => false,
|
||||
'haproxy_config_options' => {
|
||||
|
@ -57,4 +78,3 @@ describe manifest do
|
|||
end
|
||||
test_ubuntu_and_centos manifest
|
||||
end
|
||||
|
||||
|
|
|
@ -4,6 +4,21 @@ manifest = 'openstack-haproxy/openstack-haproxy-neutron.pp'
|
|||
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
|
||||
neutron_nodes = Noop.hiera_hash('neutron_nodes')
|
||||
|
||||
let(:neutron_address_map) do
|
||||
Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', neutron_nodes, 'heat/api'
|
||||
end
|
||||
|
||||
let(:ipaddresses) do
|
||||
neutron_address_map.values
|
||||
end
|
||||
|
||||
let(:server_names) do
|
||||
neutron_address_map.keys
|
||||
end
|
||||
|
||||
use_neutron = Noop.hiera('use_neutron', false)
|
||||
|
||||
if use_neutron and !Noop.hiera('external_lb', false)
|
||||
|
@ -11,6 +26,8 @@ describe manifest do
|
|||
public_ssl_neutron = Noop.hiera_structure('public_ssl/services', false)
|
||||
should contain_openstack__ha__haproxy_service('neutron').with(
|
||||
'order' => '085',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 9696,
|
||||
'public' => true,
|
||||
'public_ssl' => public_ssl_neutron,
|
||||
|
@ -27,4 +44,3 @@ describe manifest do
|
|||
|
||||
test_ubuntu_and_centos manifest
|
||||
end
|
||||
|
||||
|
|
|
@ -4,6 +4,21 @@ manifest = 'openstack-haproxy/openstack-haproxy-nova.pp'
|
|||
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
|
||||
nova_api_nodes = Noop.hiera_hash('nova_api_nodes')
|
||||
|
||||
let(:nova_api_address_map) do
|
||||
Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', nova_api_nodes, 'heat/api'
|
||||
end
|
||||
|
||||
let(:ipaddresses) do
|
||||
nova_api_address_map.values
|
||||
end
|
||||
|
||||
let(:server_names) do
|
||||
nova_api_address_map.keys
|
||||
end
|
||||
|
||||
use_nova = Noop.hiera_structure('nova/enabled', true)
|
||||
|
||||
if use_nova and !Noop.hiera('external_lb', false)
|
||||
|
@ -11,6 +26,8 @@ describe manifest do
|
|||
public_ssl_nova = Noop.hiera_structure('public_ssl/services', false)
|
||||
should contain_openstack__ha__haproxy_service('nova-api-1').with(
|
||||
'order' => '040',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 8773,
|
||||
'public' => true,
|
||||
'public_ssl' => public_ssl_nova,
|
||||
|
@ -22,6 +39,8 @@ describe manifest do
|
|||
)
|
||||
should contain_openstack__ha__haproxy_service('nova-api-2').with(
|
||||
'order' => '050',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 8774,
|
||||
'public' => true,
|
||||
'public_ssl' => public_ssl_nova,
|
||||
|
@ -37,6 +56,8 @@ describe manifest do
|
|||
it "should properly configure nova-metadata-api haproxy" do
|
||||
should contain_openstack__ha__haproxy_service('nova-metadata-api').with(
|
||||
'order' => '060',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 8775,
|
||||
'haproxy_config_options' => {
|
||||
'option' => ['httpchk', 'httplog', 'httpclose'],
|
||||
|
@ -48,6 +69,8 @@ describe manifest do
|
|||
public_ssl_nova = Noop.hiera_structure('public_ssl/services', false)
|
||||
should contain_openstack__ha__haproxy_service('nova-novncproxy').with(
|
||||
'order' => '170',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 6080,
|
||||
'public' => true,
|
||||
'public_ssl' => public_ssl_nova,
|
||||
|
|
|
@ -4,11 +4,30 @@ manifest = 'openstack-haproxy/openstack-haproxy-radosgw.pp'
|
|||
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
|
||||
images_ceph = Noop.hiera_structure 'storage/images_ceph'
|
||||
objects_ceph = Noop.hiera_structure 'storage/objects_ceph'
|
||||
|
||||
if images_ceph and objects_ceph and !Noop.hiera('external_lb', false)
|
||||
|
||||
rgw_nodes = Noop.hiera_hash('ceph_rgw_nodes')
|
||||
|
||||
let(:rgw_address_map) do
|
||||
Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', rgw_nodes, 'heat/api'
|
||||
end
|
||||
|
||||
let(:ipaddresses) do
|
||||
rgw_address_map.values
|
||||
end
|
||||
|
||||
let(:server_names) do
|
||||
rgw_address_map.keys
|
||||
end
|
||||
|
||||
ironic_enabled = Noop.hiera_structure 'ironic/enabled'
|
||||
|
||||
if ironic_enabled
|
||||
|
||||
baremetal_virtual_ip = Noop.hiera_structure 'network_metadata/vips/baremetal/ipaddr'
|
||||
|
||||
it 'should declare ::openstack::ha::radosgw class with baremetal_virtual_ip' do
|
||||
|
@ -21,6 +40,8 @@ describe manifest do
|
|||
public_ssl_radosgw = Noop.hiera_structure('public_ssl/services', false)
|
||||
should contain_openstack__ha__haproxy_service('radosgw').with(
|
||||
'order' => '130',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 8080,
|
||||
'balancermember_port' => 6780,
|
||||
'public' => true,
|
||||
|
@ -34,21 +55,25 @@ describe manifest do
|
|||
end
|
||||
|
||||
it 'should declare openstack::ha::haproxy_service with name radosgw-baremetal' do
|
||||
should contain_openstack__ha__haproxy_service('radosgw-baremetal').with(
|
||||
'order' => '135',
|
||||
'listen_port' => 8080,
|
||||
'balancermember_port' => 6780,
|
||||
'public_virtual_ip' => false,
|
||||
'internal_virtual_ip' => baremetal_virtual_ip,
|
||||
'haproxy_config_options' => {
|
||||
'option' => ['httplog', 'httpchk GET /'],
|
||||
'http-request' => 'set-header X-Forwarded-Proto https if { ssl_fc }',
|
||||
},
|
||||
)
|
||||
should contain_openstack__ha__haproxy_service('radosgw-baremetal').with(
|
||||
'order' => '135',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 8080,
|
||||
'balancermember_port' => 6780,
|
||||
'public_virtual_ip' => false,
|
||||
'internal_virtual_ip' => baremetal_virtual_ip,
|
||||
'haproxy_config_options' => {
|
||||
'option' => ['httplog', 'httpchk GET /'],
|
||||
'http-request' => 'set-header X-Forwarded-Proto https if { ssl_fc }',
|
||||
},
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end # end of shared_examples
|
||||
test_ubuntu_and_centos manifest
|
||||
end
|
||||
|
||||
|
|
|
@ -4,13 +4,31 @@ manifest = 'openstack-haproxy/openstack-haproxy-sahara.pp'
|
|||
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
|
||||
sahara_nodes = Noop.hiera_hash('sahara_nodes')
|
||||
|
||||
let(:sahara_address_map) do
|
||||
Noop.puppet_function 'get_node_to_ipaddr_map_by_network_role', sahara_nodes, 'heat/api'
|
||||
end
|
||||
|
||||
let(:ipaddresses) do
|
||||
sahara_address_map.values
|
||||
end
|
||||
|
||||
let(:server_names) do
|
||||
sahara_address_map.keys
|
||||
end
|
||||
|
||||
use_sahara = Noop.hiera_structure('sahara/enabled', false)
|
||||
|
||||
if use_sahara and !Noop.hiera('external_lb', false)
|
||||
|
||||
it "should properly configure sahara haproxy based on ssl" do
|
||||
public_ssl_sahara = Noop.hiera_structure('public_ssl/services', false)
|
||||
should contain_openstack__ha__haproxy_service('sahara').with(
|
||||
'order' => '150',
|
||||
'ipaddresses' => ipaddresses,
|
||||
'server_names' => server_names,
|
||||
'listen_port' => 8386,
|
||||
'public' => true,
|
||||
'public_ssl' => public_ssl_sahara,
|
||||
|
@ -20,8 +38,10 @@ describe manifest do
|
|||
},
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
test_ubuntu_and_centos manifest
|
||||
end
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ manifest = 'openstack-haproxy/openstack-haproxy-stats.pp'
|
|||
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
|
||||
management_vip = Noop.hiera 'management_vip'
|
||||
database_vip = Noop.hiera 'database_vip'
|
||||
database_vip ||= management_vip
|
||||
|
@ -17,6 +18,8 @@ describe manifest do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
test_ubuntu_and_centos manifest
|
||||
end
|
||||
|
|
|
@ -4,6 +4,7 @@ manifest = 'openstack-haproxy/openstack-haproxy-swift.pp'
|
|||
|
||||
describe manifest do
|
||||
shared_examples 'catalog' do
|
||||
|
||||
ironic_enabled = Noop.hiera_structure 'ironic/enabled'
|
||||
|
||||
# Determine if swift is used
|
||||
|
@ -40,6 +41,7 @@ describe manifest do
|
|||
end
|
||||
|
||||
if use_swift and !Noop.hiera('external_lb', false)
|
||||
|
||||
it "should declare openstack::ha:swift class with valid params" do
|
||||
should contain_class('openstack::ha::swift').with(
|
||||
'bind_to_one' => bind_to_one,
|
||||
|
@ -59,6 +61,7 @@ describe manifest do
|
|||
end
|
||||
|
||||
if ironic_enabled
|
||||
|
||||
baremetal_virtual_ip = Noop.hiera_structure 'network_metadata/vips/baremetal/ipaddr'
|
||||
|
||||
it 'should declare ::openstack::ha::swift class with baremetal_virtual_ip' do
|
||||
|
@ -66,6 +69,7 @@ describe manifest do
|
|||
'baremetal_virtual_ip' => baremetal_virtual_ip,
|
||||
)
|
||||
end
|
||||
|
||||
it 'should declare openstack::ha::haproxy_service with name swift-baremetal' do
|
||||
should contain_openstack__ha__haproxy_service('swift-baremetal').with(
|
||||
'order' => '125',
|
||||
|
@ -76,9 +80,11 @@ describe manifest do
|
|||
'balancermember_options' => bm_options,
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end # end of shared_examples
|
||||
test_ubuntu_and_centos manifest
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue