Ensure /etc/mysql/my.cnf removal

Additional fix to conflicting mysql config files
in order to fix mysql syslog logging in Ubuntu.
For simple deployment (custom_setup_class undef):
* /etc/mysql/my.conf should be used in Ubuntu
For HA case for Centos/Ubuntu:
* /etc/mysql/my.conf should be absent
* /etc/my.cnf should be used
(Note that changes are Fuel OSCI packaging specific)

Closes-bug: #1349601

Change-Id: I56c1b5ebca2553d341fe0498451075294f3e651f
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
Bogdan Dobrelya
2014-08-19 16:19:23 +03:00
parent 9d510cdc0e
commit 7507eb0b0f
2 changed files with 23 additions and 5 deletions

View File

@@ -40,16 +40,24 @@ class mysql::server (
$use_syslog = true,
) inherits mysql::params {
if ($config_hash['config_file']) {
$config_file_real = $config_hash['config_file']
} else {
$config_file_real = $mysql::params::config_file
}
class { 'mysql::password' :
root_password => $root_password,
old_root_password => $old_root_password,
etc_root_password => $etc_root_password,
config_file => $config_file_real,
}
class { 'mysql::config' :
bind_address => $bind_address,
use_syslog => $use_syslog,
custom_setup_class => $custom_setup_class,
config_file => $config_file_real,
}
Exec {path => '/usr/bin:/bin:/usr/sbin:/sbin'}

View File

@@ -76,22 +76,32 @@ class openstack::db::mysql (
$use_syslog = false,
) {
if $custom_setup_class {
file { '/etc/mysql/my.cnf':
ensure => absent,
require => Class['mysql::server']
}
$config_hash_real = {
'config_file' => '/etc/my.cnf'
}
} else {
$config_hash_real = {}
}
class { "mysql::server" :
bind_address => '0.0.0.0',
etc_root_password => true,
root_password => $mysql_root_password,
old_root_password => '',
galera_cluster_name => $galera_cluster_name,
galera_cluster_name => $galera_cluster_name,
primary_controller => $primary_controller,
galera_node_address => $galera_node_address,
galera_node_address => $galera_node_address,
galera_nodes => $galera_nodes,
enabled => $enabled,
custom_setup_class => $custom_setup_class,
mysql_skip_name_resolve => $mysql_skip_name_resolve,
use_syslog => $use_syslog,
config_hash => {
'config_file' => '/etc/my.cnf'
},
config_hash => $config_hash_real,
}
# This removes default users and guest access