module-puppetlabs-mysql/manifests/server/installdb.pp
Maksim Malchuk 61619f69fc Use mysql_install_db only with uniq defaults-extra-file
Executing mysql_install_db with the defaults-extra-file set to the
global option file can produce errors with duplicates. For example it
happens when 'ignore-db-dir' option passed to $override_options in
mysql::server class. Same as https://bugs.mysql.com/bug.php?id=69441
2016-03-11 22:24:55 +03:00

33 lines
885 B
Puppet

#
class mysql::server::installdb {
if $mysql::server::package_manage {
# Build the initial databases.
$mysqluser = $mysql::server::options['mysqld']['user']
$datadir = $mysql::server::options['mysqld']['datadir']
$basedir = $mysql::server::options['mysqld']['basedir']
$config_file = $mysql::server::config_file
if $mysql::server::manage_config_file and $config_file != $mysql::params::config_file {
$_config_file=$config_file
} else {
$_config_file=undef
}
mysql_datadir { $datadir:
ensure => 'present',
datadir => $datadir,
basedir => $basedir,
user => $mysqluser,
defaults_extra_file => $_config_file,
}
if $mysql::server::restart {
Mysql_datadir[$datadir] {
notify => Class['mysql::server::service'],
}
}
}
}