module-puppetlabs-mysql/manifests/server/config.pp

63 lines
1.8 KiB
ObjectPascal
Raw Normal View History

# See README.me for options.
class mysql::server::config {
$options = $mysql::server::options
$includedir = $mysql::server::includedir
File {
owner => 'root',
group => $mysql::server::root_group,
mode => '0400',
}
if $includedir and $includedir != '' {
2014-12-16 20:18:43 +01:00
file { $includedir:
ensure => directory,
mode => '0755',
recurse => $mysql::server::purge_conf_dir,
purge => $mysql::server::purge_conf_dir,
}
# 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',
}
}
}
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 {
$logbindir = mysql_dirname($logbin)
2015-03-02 20:27:56 +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
}
}
if $mysql::server::manage_config_file {
file { 'mysql-config-file':
path => $mysql::server::config_file,
content => template('mysql/my.cnf.erb'),
mode => '0644',
selinux_ignore_defaults => true,
}
}
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'
}
}
}