diff options
Diffstat (limited to 'manifests/profile/base/database/mysql.pp')
-rw-r--r-- | manifests/profile/base/database/mysql.pp | 68 |
1 files changed, 65 insertions, 3 deletions
diff --git a/manifests/profile/base/database/mysql.pp b/manifests/profile/base/database/mysql.pp index 49c9df3..9da1456 100644 --- a/manifests/profile/base/database/mysql.pp +++ b/manifests/profile/base/database/mysql.pp @@ -18,6 +18,14 @@ # # === Parameters # +# [*bind_address*] +# (Optional) The address that the local mysql instance should bind to. +# Defaults to $::hostname +# +# [*bootstrap_node*] +# (Optional) The hostname of the node responsible for bootstrapping tasks +# Defaults to hiera('bootstrap_nodeid') +# # [*manage_resources*] # (Optional) Whether or not manage root user, root my.cnf, and service. # Defaults to true @@ -37,13 +45,20 @@ # Defaults to hiera('step') # class tripleo::profile::base::database::mysql ( + $bind_address = $::hostname, + $bootstrap_node = hiera('bootstrap_nodeid', undef), $manage_resources = true, $mysql_server_options = {}, $remove_default_accounts = true, $step = hiera('step'), - ) { + if $::hostname == downcase($bootstrap_node) { + $sync_db = true + } else { + $sync_db = false + } + validate_hash($mysql_server_options) # non-ha scenario @@ -59,14 +74,14 @@ class tripleo::profile::base::database::mysql ( } else { $mysql_config_file = '/etc/my.cnf.d/server.cnf' } - # TODO Galara + # TODO Galera # FIXME: due to https://bugzilla.redhat.com/show_bug.cgi?id=1298671 we # set bind-address to a hostname instead of an ip address; to move Mysql # from internal_api on another network we'll have to customize both # MysqlNetwork and ControllerHostnameResolveNetwork in ServiceNetMap $mysql_server_default = { 'mysqld' => { - 'bind-address' => $::hostname, + 'bind-address' => $bind_address, 'max_connections' => hiera('mysql_max_connections'), 'open_files_limit' => '-1', } @@ -83,4 +98,51 @@ class tripleo::profile::base::database::mysql ( } } + if $step >= 2 and $sync_db { + Class['::mysql::server'] -> Mysql_database<||> + if hiera('aodh_api_enabled', false) { + include ::aodh::db::mysql + } + if hiera('ceilometer_collector_enabled', false) { + include ::ceilometer::db::mysql + } + if hiera('cinder_api_enabled', false) { + include ::cinder::db::mysql + } + if hiera('glance_registry_enabled', false) { + include ::glance::db::mysql + } + if hiera('gnocchi_api_enabled', false) { + include ::gnocchi::db::mysql + } + if hiera('heat_engine_enabled', false) { + include ::heat::db::mysql + } + if hiera('ironic_api_enabled', false) { + include ::ironic::db::mysql + } + if hiera('keystone_enabled', false) { + include ::keystone::db::mysql + } + if hiera('manila_api_enabled', false) { + include ::manila::db::mysql + } + if hiera('mistral_api_enabled', false) { + include ::mistral::db::mysql + } + if hiera('neutron_api_enabled', false) { + include ::neutron::db::mysql + } + if hiera('nova_api_enabled', false) { + include ::nova::db::mysql + include ::nova::db::mysql_api + } + if hiera('sahara_api_enabled', false) { + include ::sahara::db::mysql + } + if hiera('trove_api_enabled', false) { + include ::trove::db::mysql + } + } + } |