module-mysql/manifests/init.pp

54 lines
1.2 KiB
ObjectPascal
Raw Normal View History

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