module-mysql/manifests/server.pp
Gabriel Filion ae2fbce7ac Randomize time of execution for optimize script.
By default, time will be between midnight and 7:00 any day of the week.

The values are currently hard-coded. This can have serious I/O
repercussions on a server with multiple VMs that run mysql since they
will all run their optimizations simultaneously.
2014-03-06 18:46:06 -05:00

45 lines
1.3 KiB
Puppet

# manage a mysql server
class mysql::server (
$root_password,
$manage_shorewall = false,
$manage_munin = false,
$munin_password = 'absent',
$manage_nagios = false,
$nagios_password_hash = 'absent',
$backup_cron = false,
$optimize_cron = false,
$optimize_hour = fqdn_rand(7),
$optimize_minute = fqdn_rand(60),
$optimize_day = fqdn_rand(7),
$backup_dir = '/var/backups/mysql',
$manage_backup_dir = true,
$nagios_notcp = false
) {
case $::operatingsystem {
gentoo: { include mysql::server::gentoo }
centos: { include mysql::server::centos }
debian: { include mysql::server::debian }
default: { include mysql::server::base }
}
if $manage_munin and $::mysql_exists == 'true' {
if $munin_password == 'absent' {
fail('need to set the munin password')
}
case $::operatingsystem {
debian: { include mysql::server::munin::debian }
default: { include mysql::server::munin::default }
}
}
if $manage_nagios and $::mysql_exists == 'true' {
if $nagios_password_hash == 'absent' {
fail('need to set the nagios password hash')
}
include mysql::server::nagios
}
if $manage_shorewall {
include shorewall::rules::mysql
}
}