2013-09-09 17:34:39 +02:00
|
|
|
# See README.me for options.
|
|
|
|
class mysql::server::config {
|
2012-08-13 10:59:28 +02:00
|
|
|
|
2013-09-25 00:04:29 +02:00
|
|
|
$options = $mysql::server::options
|
2014-06-04 14:05:39 +02:00
|
|
|
$includedir = $mysql::server::includedir
|
2013-09-25 00:04:29 +02:00
|
|
|
|
2013-09-09 17:34:39 +02:00
|
|
|
File {
|
|
|
|
owner => 'root',
|
2013-09-25 00:04:29 +02:00
|
|
|
group => $mysql::server::root_group,
|
2013-09-09 17:34:39 +02:00
|
|
|
mode => '0400',
|
|
|
|
}
|
|
|
|
|
2014-06-04 14:05:39 +02:00
|
|
|
if $includedir and $includedir != '' {
|
2014-12-16 20:18:43 +01:00
|
|
|
file { $includedir:
|
2014-06-04 14:05:39 +02:00
|
|
|
ensure => directory,
|
|
|
|
mode => '0755',
|
|
|
|
recurse => $mysql::server::purge_conf_dir,
|
|
|
|
purge => $mysql::server::purge_conf_dir,
|
|
|
|
}
|
2016-04-13 15:27:25 +02:00
|
|
|
|
|
|
|
# on some systems this is /etc/my.cnf.d, while Debian has /etc/mysql/conf.d and FreeBSD something in /usr/local. For the latter systems,
|
|
|
|
# managing this basedir is also required, to have it available before the package is installed.
|
|
|
|
$includeparentdir = mysql_dirname($includedir)
|
|
|
|
if $includeparentdir != '/' and $includeparentdir != '/etc' {
|
|
|
|
file { $includeparentdir:
|
|
|
|
ensure => directory,
|
|
|
|
mode => '0755',
|
|
|
|
}
|
|
|
|
}
|
2012-08-13 10:59:28 +02:00
|
|
|
}
|
2014-12-16 20:18:43 +01:00
|
|
|
|
2014-11-06 03:14:35 +01:00
|
|
|
$logbin = pick($options['mysqld']['log-bin'], $options['mysqld']['log_bin'], false)
|
2014-12-16 20:18:43 +01:00
|
|
|
|
2014-11-06 03:14:35 +01:00
|
|
|
if $logbin {
|
2015-02-24 20:08:29 +01:00
|
|
|
$logbindir = mysql_dirname($logbin)
|
2015-03-02 20:27:56 +01:00
|
|
|
|
2015-01-29 04:39:31 +01:00
|
|
|
#Stop puppet from managing directory if just a filename/prefix is specified
|
|
|
|
if $logbindir != '.' {
|
|
|
|
file { $logbindir:
|
|
|
|
ensure => directory,
|
|
|
|
mode => '0755',
|
|
|
|
owner => $options['mysqld']['user'],
|
|
|
|
group => $options['mysqld']['user'],
|
|
|
|
}
|
2014-11-06 03:14:35 +01:00
|
|
|
}
|
|
|
|
}
|
2012-08-13 10:59:28 +02:00
|
|
|
|
2013-09-25 00:04:29 +02:00
|
|
|
if $mysql::server::manage_config_file {
|
2014-07-28 07:51:22 +02:00
|
|
|
file { 'mysql-config-file':
|
2015-08-04 19:38:03 +02:00
|
|
|
path => $mysql::server::config_file,
|
|
|
|
content => template('mysql/my.cnf.erb'),
|
|
|
|
mode => '0644',
|
|
|
|
selinux_ignore_defaults => true,
|
2012-08-13 10:59:28 +02:00
|
|
|
}
|
2016-04-14 15:02:10 +02:00
|
|
|
|
|
|
|
# on mariadb systems, $includedir is not defined, but /etc/my.cnf.d has
|
|
|
|
# to be managed to place the server.cnf there
|
|
|
|
$configparentdir = mysql_dirname($mysql::server::config_file)
|
|
|
|
if $configparentdir != '/' and $configparentdir != '/etc' and $configparentdir != $includedir and $configparentdir != mysql_dirname($includedir) {
|
|
|
|
file { $configparentdir:
|
|
|
|
ensure => directory,
|
|
|
|
mode => '0755',
|
|
|
|
}
|
|
|
|
}
|
2012-08-13 10:59:28 +02:00
|
|
|
}
|
2014-03-04 14:58:17 +01:00
|
|
|
|
|
|
|
if $options['mysqld']['ssl-disable'] {
|
|
|
|
notify {'ssl-disable':
|
|
|
|
message =>'Disabling SSL is evil! You should never ever do this except if you are forced to use a mysql version compiled without SSL support'
|
|
|
|
}
|
|
|
|
}
|
2012-08-13 10:59:28 +02:00
|
|
|
}
|