906eb4217b
- 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>
44 lines
963 B
Puppet
44 lines
963 B
Puppet
# == Class osnailyfacter::mysql_access
|
|
#
|
|
# Class that configures .my.cnf for services
|
|
#
|
|
# === Parameters:
|
|
#
|
|
# [*db_user*]
|
|
# (optional) The mysql user to create
|
|
# Defaults to 'root'
|
|
#
|
|
# [*db_password*]
|
|
# Password to use for db_user
|
|
#
|
|
# [*db_host*]
|
|
# (optional) The IP address of the mysql server
|
|
# Defaults to '127.0.0.1'
|
|
#
|
|
class osnailyfacter::mysql_access (
|
|
$ensure = 'present',
|
|
$db_user = 'root',
|
|
$db_password = '',
|
|
$db_host = 'localhost',
|
|
) {
|
|
$default_file_path = '/root/.my.cnf'
|
|
$host_file_path = "/root/.my.${db_host}.cnf"
|
|
|
|
file { "${db_host}-mysql-access":
|
|
ensure => $ensure,
|
|
path => $host_file_path,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0640',
|
|
content => template('osnailyfacter/mysql.access.cnf.erb')
|
|
}
|
|
|
|
if $ensure == 'present' {
|
|
file { 'default-mysql-access-link':
|
|
ensure => 'symlink',
|
|
path => $default_file_path,
|
|
target => $host_file_path,
|
|
}
|
|
}
|
|
}
|