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,
|
|
|
|
$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 }
|
|
|
|
}
|
2012-02-10 14:35:19 +01:00
|
|
|
|
2013-02-18 22:16:35 +01:00
|
|
|
if $manage_munin and $::mysql_exists == 'true' {
|
2013-01-02 18:48:49 +01:00
|
|
|
if $munin_password == 'absent' {
|
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
|
|
|
}
|
2009-12-11 21:25:20 +01:00
|
|
|
|
2013-02-18 22:16:35 +01: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
|
|
|
}
|
2009-12-11 21:25:20 +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
|
|
|
}
|