module-mysql/manifests/server.pp

46 lines
1.3 KiB
ObjectPascal
Raw Permalink Normal View History

2012-12-09 15:12:19 +01:00
# manage a mysql server
2012-06-14 01:22:45 +02:00
class mysql::server (
2013-01-02 18:48:49 +01:00
$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),
2013-01-02 18:48:49 +01:00
$backup_dir = '/var/backups/mysql',
$manage_backup_dir = true,
$nagios_notcp = false
2012-06-14 01:22:45 +02:00
) {
2012-06-08 18:04:06 +02:00
case $::operatingsystem {
2012-06-14 01:22:45 +02:00
gentoo: { include mysql::server::gentoo }
centos: { include mysql::server::centos }
debian: { include mysql::server::debian }
2012-06-08 18:04:06 +02:00
default: { include mysql::server::base }
}
if $manage_munin and $::mysql_exists == 'true' {
2014-03-11 19:52:56 +01:00
if $munin_password == 'absent' and $::operatingsystem != debian {
2013-01-16 03:30:44 +01:00
fail('need to set the munin password')
2013-01-02 18:48:49 +01:00
}
2012-06-08 18:04:06 +02:00
case $::operatingsystem {
2012-06-14 01:22:45 +02:00
debian: { include mysql::server::munin::debian }
2012-06-08 18:04:06 +02:00
default: { include mysql::server::munin::default }
2009-10-03 15:19:11 +02:00
}
2012-06-08 18:04:06 +02:00
}
if $manage_nagios and $::mysql_exists == 'true' {
2013-01-02 18:48:49 +01:00
if $nagios_password_hash == 'absent' {
2013-01-16 03:30:44 +01:00
fail('need to set the nagios password hash')
2013-01-02 18:54:51 +01:00
}
2012-06-14 01:22:45 +02:00
include mysql::server::nagios
2012-12-09 15:12:19 +01:00
}
2012-06-14 16:33:31 +02:00
if $manage_shorewall {
2012-06-08 18:04:06 +02:00
include shorewall::rules::mysql
}
2009-10-03 15:19:11 +02:00
}