![Mykyta Koshykov](/assets/img/avatar_default.png)
- Move DB creation for every service to own task - Refactor Murano and Sahara DB configuration classes - Cherry-pick MySQL providers from upstream to allow DB creation and management on remote host - Remove openstack::db::mysql - Move database and user creation to a separete task - Either install local database or use an external one Implements: blueprint: detach-components-from-controllers Co-Authored-By: Sergii Golovatiuk <sgolovatiuk@mirantis.com> Co-Authored-By: Dmitry Ilyin <dilyin@mirantis.com> Change-Id: Iaf3b7913e8c79c08025dbdaf5f2beff7337ab644 Signed-off-by: Sergii Golovatiuk <sgolovatiuk@mirantis.com>
46 lines
1.4 KiB
Puppet
46 lines
1.4 KiB
Puppet
notice('MODULAR: keystone_db.pp')
|
|
|
|
$keystone_hash = hiera_hash('keystone', {})
|
|
$mysql_hash = hiera_hash('mysql', {})
|
|
$management_vip = hiera('management_vip', undef)
|
|
$database_vip = hiera('database_vip', undef)
|
|
|
|
$mysql_root_user = pick($mysql_hash['root_user'], 'root')
|
|
$mysql_db_create = pick($mysql_hash['db_create'], true)
|
|
$mysql_root_password = $mysql_hash['root_password']
|
|
|
|
$db_user = pick($keystone_hash['db_user'], 'keystone')
|
|
$db_name = pick($keystone_hash['db_name'], 'keystone')
|
|
$db_password = pick($keystone_hash['db_password'], $mysql_root_password)
|
|
|
|
$db_host = pick($keystone_hash['db_host'], $database_vip, $management_vip, 'localhost')
|
|
$db_create = pick($keystone_hash['db_create'], $mysql_db_create)
|
|
$db_root_user = pick($keystone_hash['root_user'], $mysql_root_user)
|
|
$db_root_password = pick($keystone_hash['root_password'], $mysql_root_password)
|
|
|
|
$allowed_hosts = [ $::hostname, 'localhost', '127.0.0.1', '%' ]
|
|
|
|
if $db_create {
|
|
|
|
class { 'keystone::db::mysql':
|
|
user => $db_user,
|
|
password => $db_password,
|
|
dbname => $db_name,
|
|
allowed_hosts => $allowed_hosts,
|
|
}
|
|
|
|
class { 'osnailyfacter::mysql_access':
|
|
db_host => $db_host,
|
|
db_user => $db_root_user,
|
|
db_password => $db_root_password,
|
|
}
|
|
|
|
Class['osnailyfacter::mysql_access'] -> Class['keystone::db::mysql']
|
|
|
|
}
|
|
|
|
class mysql::config {}
|
|
include mysql::config
|
|
class mysql::server {}
|
|
include mysql::server
|