
This commit contains changes and notes related to the initial code review between joe topjian and myself. It is not intended to be merged, but it part of an ongoing collaboration for a refactor of this module.
86 lines
2.1 KiB
Puppet
86 lines
2.1 KiB
Puppet
#
|
|
# === Class: openstack::db::mysql
|
|
#
|
|
# Create MySQL databases for all components of
|
|
# OpenStack that require a database
|
|
#
|
|
# === Parameters
|
|
#
|
|
# See params.pp
|
|
#
|
|
# === Example
|
|
#
|
|
# class { 'openstack::db::mysql':
|
|
# mysql_root_password => 'changeme',
|
|
# keystone_db_password => 'changeme',
|
|
# glance_db_password => 'changeme',
|
|
# nova_db_password => 'changeme',
|
|
# allowed_hosts => ['127.0.0.1', '10.0.0.%'],
|
|
# }
|
|
|
|
|
|
class openstack::db::mysql (
|
|
# Required MySQL
|
|
# passwords
|
|
$mysql_root_password,
|
|
$keystone_db_password,
|
|
$glance_db_password,
|
|
$nova_db_password
|
|
# MySQL
|
|
$mysql_bind_address = '0.0.0.0',
|
|
$mysql_account_security = true,
|
|
# Keystone
|
|
$keystone_db_user = 'keystone',
|
|
$keystone_db_dbname = 'keystone',
|
|
# Glance
|
|
$glance_db_user = 'glance',
|
|
$glance_db_dbname = 'glance',
|
|
# Nova
|
|
$nova_db_user = 'nova',
|
|
$nova_db_dbname = 'nova',
|
|
$allowed_hosts = false,
|
|
$enabled = true
|
|
) {
|
|
|
|
# Install and configure MySQL Server
|
|
class { 'mysql::server':
|
|
config_hash => {
|
|
'root_password' => $mysql_root_password,
|
|
'bind_address' => $mysql_bind_address,
|
|
}
|
|
enabled => $enabled,
|
|
}
|
|
|
|
if $enabled {
|
|
# If enabled, secure the mysql installation
|
|
# This removes default users and guest access
|
|
if $mysql_account_security {
|
|
class { 'mysql::server::account_security': }
|
|
}
|
|
|
|
# Create the Keystone db
|
|
class { 'keystone::db::mysql':
|
|
user => $keystone_db_user,
|
|
password => $keystone_db_password,
|
|
dbname => $keystone_db_dbname,
|
|
allowed_hosts => $allowed_hosts,
|
|
}
|
|
|
|
# Create the Glance db
|
|
class { 'glance::db::mysql':
|
|
user => $glance_db_user,
|
|
password => $glance_db_password,
|
|
dbname => $glance_db_dbname,
|
|
allowed_hosts => $allowed_hosts,
|
|
}
|
|
|
|
# Create the Nova db
|
|
class { 'nova::db::mysql':
|
|
user => $nova_db_user,
|
|
password => $nova_db_password,
|
|
dbname => $nova_db_dbname,
|
|
allowed_hosts => $allowed_hosts,
|
|
}
|
|
}
|
|
}
|