Fix support for changing settings for some of the services

Allow a user to change particular openstack and misc
services configuration.

Supports:
  ceilometer
  cinder
  glance
  haproxy
  heat
  mysql
  rabbitmq

DocImpact

Closes-bug: #1580522

Change-Id: I2933846f78c94933419d4dfd3dfbe49178172ff9
This commit is contained in:
Vladimir Kuklin 2016-04-04 15:31:14 +03:00
parent 51120a564f
commit aa5bebf811
17 changed files with 159 additions and 27 deletions

View File

@ -56,6 +56,7 @@ class cluster::haproxy (
$colocate_haproxy = false,
$stats_ipaddresses = ['127.0.0.1'],
$spread_checks = '3',
$user_defined_options = {}
) {
include ::haproxy::params
include ::rsyslog::params
@ -105,9 +106,10 @@ class cluster::haproxy (
$service_name = 'p_haproxy'
class { 'haproxy::base':
global_options => $global_options,
defaults_options => $defaults_options,
global_options => merge($global_options, $user_defined_options['global']),
defaults_options => merge($defaults_options, $user_defined_options['defaults']),
stats_ipaddresses => $stats_ipaddresses,
custom_fragment => $user_defined_options['custom_fragment'],
use_include => true,
}

View File

@ -29,6 +29,7 @@ class haproxy::base (
$use_stats = $haproxy::params::use_stats,
$stats_port = $haproxy::params::stats_port,
$stats_ipaddresses = $haproxy::params::stats_ipaddresses,
$custom_fragment = undef,
) inherits haproxy::params {
concat { '/etc/haproxy/haproxy.cfg':

View File

@ -18,7 +18,8 @@
('mongo' in $.node_roles)),
('primary-controller' in $.roles), $.get('kombu_compression'),
$.get('service_endpoint'), $.get('use_ssl'), $.get('workers_max'),
$.network_scheme, $.mongo, $.external_mongo, $.get('amqp_hosts'))
$.network_scheme, $.mongo, $.external_mongo, $.get('amqp_hosts'),
$.configuration.get('ceilometer'), $.configuration.get('ceilometer_api_paste_ini'))
parameters:
puppet_manifest: /etc/puppet/modules/openstack_tasks/examples/ceilometer/controller.pp
puppet_modules: /etc/puppet/modules

View File

@ -13,7 +13,9 @@
$.get('max_pool_size'), $.get('max_overflow'), $.ceilometer,
$.get('region', 'RegionOne'), $.ironic,
('primary-controller' in $.roles), $.get('kombu_compression'),
$.get('amqp_hosts'), $.get('use_ssl'), $.murano)
$.get('amqp_hosts'), $.get('use_ssl'), $.murano,
$.configuration.get('glance_api'), $.configuration.get('glance_cache'),
$.configuration.get('glance_registry'), $.configuration.get('glare_config'))
cross-depends:
- name: glance-db
- name: glance-keystone

View File

@ -15,6 +15,7 @@
$.get('syslog_log_facility_heat'), $.deployment_mode,
$.get('region', 'RegionOne'), $.get('external_lb'),
$.get('database_vip'), $.get('heat_db_name'), $.get('amqp_hosts'),
$.configuration.get('heat'), $.configuration.get('heat_api_paste_ini'),
$.get('heat_ha_engine'))
cross-depends:
- name: heat-db

View File

@ -14,7 +14,8 @@
$.get('glance_endpoint'), $.get('glance_api_servers'),
$.get('use_syslog'), $.get('use_stderr'), $.get('verbose'), $.debug,
$.get('amqp_hosts'), $.get('syslog_log_facility_cinder'),
$.get('cinder_rate_limits'), $.get('keystone_api', 'v3'))
$.get('cinder_rate_limits'), $.get('keystone_api', 'v3'),
$.configuration.get('cinder_api_paste_ini'), $.configuration.get('cinder') )
cross-depends:
- name: cinder-db
- name: cinder-keystone

View File

@ -41,6 +41,20 @@ class openstack_tasks::ceilometer::compute {
$keystone_identity_uri = "${admin_auth_protocol}://${admin_auth_endpoint}:35357/"
$keystone_auth_uri = "${internal_auth_protocol}://${internal_auth_endpoint}:5000/"
$override_configuration = hiera_hash('configuration', {})
# override ceilometer.conf options
override_resources { 'ceilometer_config':
data => $override_configuration['ceilometer']
}
# override ceilometer api paste options
override_resources { 'ceilometer_api_paste_ini':
data => $override_configuration['ceilometer_api_paste_ini']
}
Override_resources <||> ~> Service <| tag == 'ceilometer-service' |>
if ($ceilometer_enabled) {
class { '::ceilometer':

View File

@ -61,6 +61,20 @@ class openstack_tasks::ceilometer::controller {
$mongo_hash = hiera_hash('mongo', $default_mongo_hash)
$db_type = 'mongodb'
$override_configuration = hiera_hash('configuration', {})
# override ceilometer.conf options
override_resources { 'ceilometer_config':
data => $override_configuration['ceilometer']
}
# override ceilometer api paste options
override_resources { 'ceilometer_api_paste_ini':
data => $override_configuration['ceilometer_api_paste_ini']
}
Override_resources <||> ~> Service <| tag == 'ceilometer-service' |>
if $mongo_hash['enabled'] and $ceilometer_hash['enabled'] {
$external_mongo_hash = hiera_hash('external_mongo')
$db_user = $external_mongo_hash['mongo_user']

View File

@ -29,6 +29,30 @@ class openstack_tasks::glance::glance {
$primary_controller = hiera('primary_controller')
$kombu_compression = hiera('kombu_compression', '')
$override_configuration = hiera_hash('configuration', {})
# override glance api options
override_resources { 'glance_api_config':
data => $override_configuration['glance_api']
}
# override glance registry options
override_resources { 'glance_registry_config':
data => $override_configuration['glance_registry']
}
# override glance cache options
override_resources { 'glance_cache_config':
data => $override_configuration['glance_cache']
}
# override glare config options
override_resources { 'glance_glare_config':
data => $override_configuration['glare_config']
}
Override_resources <||> ~> Service <| tag == 'glance-service' |>
$db_type = 'mysql'
$db_host = pick($glance_hash['db_host'], $database_vip)
$db_user = pick($glance_hash['db_user'], 'glance')

View File

@ -54,6 +54,20 @@ class openstack_tasks::heat::heat {
$region = hiera('region', 'RegionOne')
$external_lb = hiera('external_lb', false)
$override_configuration = hiera_hash('configuration', {})
# override heat.conf options
override_resources { 'heat_config':
data => $override_configuration['heat']
}
# override heat api paste options
override_resources { 'heat_api_paste_ini':
data => $override_configuration['heat_api_paste_ini']
}
Override_resources <||> ~> Service <| tag == 'heat-service' |>
$db_type = 'mysql'
$db_host = pick($heat_hash['db_host'], hiera('database_vip'))
$db_user = pick($heat_hash['db_user'], 'heat')

View File

@ -44,6 +44,21 @@ class openstack_tasks::openstack_cinder::openstack_cinder {
})
$queue_provider = hiera('queue_provider', 'rabbit')
$override_configuration = hiera_hash('configuration', {})
# override cinder.conf options
override_resources { 'cinder_config':
data => $override_configuration['cinder']
}
# override cinder api paste options
override_resources { 'cinder_api_paste_ini':
data => $override_configuration['cinder_api_paste_ini']
}
Override_resources <||> ~> Service <| tag == 'cinder-service' |>
$keystone_auth_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'protocol', 'http')
$keystone_auth_host = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'hostname', [hiera('keystone_endpoint', ''), $service_endpoint, $management_vip])

View File

@ -12,18 +12,21 @@ class osnailyfacter::cluster_haproxy::cluster_haproxy {
#FIXME(mattymo): Move colocations to a separate task
$colocate_haproxy = hiera('colocate_haproxy', true)
$override_configuration = hiera_hash('configuration', {})
$user_defined_options = $override_configuration['haproxy']
if !$external_lb {
#FIXME(mattymo): Replace with only VIPs for roles assigned to this node
$stats_ipaddresses = delete_undef_values([$management_vip, $database_vip, $service_endpoint, '127.0.0.1'])
class { '::cluster::haproxy':
haproxy_maxconn => '16000',
haproxy_bufsize => '32768',
primary_controller => $primary_controller,
debug => pick($haproxy_hash['debug'], hiera('debug', false)),
other_networks => direct_networks($network_scheme['endpoints']),
stats_ipaddresses => $stats_ipaddresses,
colocate_haproxy => $colocate_haproxy,
haproxy_maxconn => '16000',
haproxy_bufsize => '32768',
primary_controller => $primary_controller,
debug => pick($haproxy_hash['debug'], hiera('debug', false)),
other_networks => direct_networks($network_scheme['endpoints']),
stats_ipaddresses => $stats_ipaddresses,
colocate_haproxy => $colocate_haproxy,
user_defined_options => $user_defined_options
}
}

View File

@ -44,6 +44,8 @@ class osnailyfacter::database::database {
$external_lb = hiera('external_lb', false)
$configuration = hiera_hash('configuration', {})
$mysql_user_defined_configuration = pick($configuration['mysql'], {})
#############################################################################
validate_string($status_password)
validate_string($mysql_root_password)
@ -248,7 +250,7 @@ class osnailyfacter::database::database {
$syslog_options
)
$galera_options = mysql_deepmerge($wsrep_options, $vendor_override_options)
$override_options = mysql_deepmerge($mysql_override_options, $galera_options)
$override_options = mysql_deepmerge($mysql_override_options, $galera_options, $mysql_user_defined_configuration)
class { '::galera':
vendor_type => $vendor_type,

View File

@ -72,14 +72,21 @@ class osnailyfacter::rabbitmq::rabbitmq {
$epmd_bind_ip_address = $rabbitmq_bind_ip_address
}
$config_kernel_variables = hiera('rabbit_config_kernel_variables',
{
$configuration = hiera_hash('configuration', {})
$config_vars = pick($configuration['rabbitmq'], {})
$config_kernel_variables = pick(
$config_vars['kernel'],
hiera_hash('rabbit_config_kernel_variables', {})
)
$config_kernel_variables_default = {
'inet_dist_listen_min' => '41055',
'inet_dist_listen_max' => '41055',
'inet_default_connect_options' => '[{nodelay,true}]',
'net_ticktime' => '10',
}
)
}
$config_kernel_variables_merged = merge ($config_kernel_variables_default, $config_kernel_variables)
$config_variables_default = {
'log_levels' => $rabbit_levels,
@ -93,14 +100,18 @@ class osnailyfacter::rabbitmq::rabbitmq {
# Erlang processes that will accept connections
'num_tcp_acceptors' => 10,
}
$config_variables = merge($config_variables_default, hiera_hash('rabbit_config_variables', {}))
$config_management_variables = hiera('rabbit_config_management_variables',
{
$config_variables = pick($config_vars['application'], hiera_hash('rabbit_config_variables', {}))
$config_variables_merged = merge($config_variables_default, $config_variables)
$config_management_variables = pick($config_vars['management'], hiera_hash('rabbit_config_management_variables', {}))
$config_management_variables_default ={
'rates_mode' => 'none',
'listener' => "[{port, ${management_port}}, {ip,\"${management_bind_ip_address}\"}]",
}
)
$config_management_variables_merged = merge($config_management_variables_default, $config_management_variables)
# NOTE(bogdando) to get the limit for threads, the max amount of worker processess will be doubled
$thread_pool_calc = min($workers_max*2,max(12*$physicalprocessorcount,30))
@ -136,9 +147,9 @@ class osnailyfacter::rabbitmq::rabbitmq {
#cluster_partition_handling => $cluster_partition_handling,
version => $version,
node_ip_address => $rabbitmq_bind_ip_address,
config_kernel_variables => $config_kernel_variables,
config_management_variables => $config_management_variables,
config_variables => $config_variables,
config_kernel_variables => $config_kernel_variables_merged,
config_management_variables => $config_management_variables_merged,
config_variables => $config_variables_merged,
environment_variables => $environment_variables,
file_limit => $file_limit,
tcp_keepalive => true,

View File

@ -9,11 +9,16 @@
changedAny($.network_scheme, $.network_metadata.vips,
$.get('database_vip'), ('primary-controller' in $.roles),
$.get('haproxy'), $.get('external_lb'), $.get('colocate_haproxy'),
$.debug)
$.debug, $.configuration.get('haproxy'))
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/cluster-haproxy/cluster-haproxy.pp
puppet_modules: /etc/puppet/modules
timeout: 120
strategy:
type: parallel
amount:
yaql_exp: &haproxy_strategy >
switch($.get('deployed_before', {}).get('value') => 1, true => 6)
test_post:
cmd: ruby /etc/puppet/modules/osnailyfacter/modular/cluster-haproxy/cluster-haproxy_post.rb
@ -31,5 +36,9 @@
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/cluster-haproxy/cluster-haproxy.pp
puppet_modules: /etc/puppet/modules
timeout: 120
strategy:
type: parallel
amount:
yaql_exp: *haproxy_strategy
test_post:
cmd: ruby /etc/puppet/modules/osnailyfacter/modular/cluster-haproxy/cluster-haproxy_post.rb

View File

@ -12,13 +12,18 @@
$.network_metadata.nodes.get(concat('node-', $.uid)).network_roles.get(
'mgmt/database'),
$.get('database_nodes'), $.get('mysql_custom_setup_class'),
$.get('mysql_binary_logs'))
$.get('mysql_binary_logs'), $.configuration.get('mysql'))
cross-depends:
- name: primary-database
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/database/database.pp
puppet_modules: /etc/puppet/modules
timeout: 1800
strategy:
type: parallel
amount:
yaql_exp: &db_strategy >
switch($.get('deployed_before', {}).get('value') => 1, true => 6)
test_pre:
cmd: ruby /etc/puppet/modules/osnailyfacter/modular/database/database_pre.rb
test_post:
@ -36,6 +41,10 @@
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/database/database.pp
puppet_modules: /etc/puppet/modules
timeout: 1800
strategy:
type: parallel
amount:
yaql_exp: *db_strategy
test_pre:
cmd: ruby /etc/puppet/modules/osnailyfacter/modular/database/database_pre.rb
test_post:

View File

@ -20,11 +20,16 @@
$.get('rabbit_config_kernel_variables'),
$.get('rabbit_config_variables'),
$.get('rabbit_config_management_variables'),
$.get('rabbit_environment_variables'))
$.get('rabbit_environment_variables'), $.configuration.get('rabbitmq'))
parameters:
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/rabbitmq/rabbitmq.pp
puppet_modules: /etc/puppet/modules
timeout: 900
strategy:
type: parallel
amount:
yaql_exp: &rabbitmq_strategy >
switch($.get('deployed_before', {}).get('value') => 1, true => 3)
test_post:
cmd: ruby /etc/puppet/modules/osnailyfacter/modular/rabbitmq/rabbitmq_post.rb
@ -40,5 +45,9 @@
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/rabbitmq/rabbitmq.pp
puppet_modules: /etc/puppet/modules
timeout: 900
strategy:
type: parallel
amount:
yaql_exp: *rabbitmq_strategy
test_post:
cmd: ruby /etc/puppet/modules/osnailyfacter/modular/rabbitmq/rabbitmq_post.rb