2008-02-01 21:02:34 +01:00
|
|
|
# mysql.pp
|
|
|
|
# Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at>
|
|
|
|
# See LICENSE for the full license granted to you.
|
2008-04-04 17:30:26 +02:00
|
|
|
# changed by immerda project group (admin(at)immerda.ch)
|
2008-02-01 21:02:34 +01:00
|
|
|
|
|
|
|
class mysql::server {
|
2008-04-04 17:30:26 +02:00
|
|
|
case $operatingsystem {
|
|
|
|
gentoo: { include mysql::server::gentoo }
|
|
|
|
default: { include mysql::server::base }
|
|
|
|
}
|
|
|
|
}
|
2008-02-01 21:02:34 +01:00
|
|
|
|
2008-04-04 17:30:26 +02:00
|
|
|
class mysql::server::base {
|
|
|
|
package { mysql:
|
2008-02-01 21:02:34 +01:00
|
|
|
ensure => present,
|
2008-02-29 21:09:42 +01:00
|
|
|
}
|
2008-02-01 21:02:34 +01:00
|
|
|
|
2008-02-29 21:09:42 +01:00
|
|
|
file{
|
2008-04-04 17:30:26 +02:00
|
|
|
"/etc/mysql/my.cnf":
|
2008-02-29 21:09:42 +01:00
|
|
|
source => [
|
2008-04-04 17:30:26 +02:00
|
|
|
"puppet://$server/files/mysql/${fqdn}/my.cnf",
|
|
|
|
"puppet://$server/files/mysql/my.cnf",
|
|
|
|
"puppet://$server/mysql/my.cnf",
|
2008-02-29 21:09:42 +01:00
|
|
|
],
|
|
|
|
ensure => file,
|
|
|
|
owner => root,
|
|
|
|
group => 0,
|
|
|
|
mode => 0444,
|
2008-04-04 17:30:26 +02:00
|
|
|
require => Package[mysql],
|
|
|
|
notify => Service[mysql],
|
2008-02-29 21:09:42 +01:00
|
|
|
}
|
2008-02-01 21:02:34 +01:00
|
|
|
|
2008-04-04 17:30:26 +02:00
|
|
|
service { mysql:
|
2008-02-01 21:02:34 +01:00
|
|
|
ensure => running,
|
|
|
|
hasstatus => true,
|
2008-04-04 17:30:26 +02:00
|
|
|
require => Package[mysql],
|
2008-02-29 21:09:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
munin::plugin {
|
|
|
|
[mysql_bytes, mysql_queries, mysql_slowqueries, mysql_threads]:
|
2008-02-01 21:02:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Collect all databases and users
|
|
|
|
Mysql_database<<||>>
|
|
|
|
Mysql_user<<||>>
|
|
|
|
Mysql_grant<<||>>
|
2008-04-04 17:30:26 +02:00
|
|
|
}
|
2008-02-01 21:02:34 +01:00
|
|
|
|
2008-04-04 17:30:26 +02:00
|
|
|
class mysql::server::gentoo inherits mysql::server::base {
|
|
|
|
Package[mysql] {
|
|
|
|
category => 'dev-db',
|
|
|
|
}
|
2008-02-01 21:02:34 +01:00
|
|
|
}
|