diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 21 | ||||
-rw-r--r-- | manifests/munin.pp | 5 |
2 files changed, 16 insertions, 10 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 47f580f..81feee0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -22,13 +22,18 @@ class mysql::server { default: { include mysql::server::base } } - if $selinux { - include mysql::selinux + # avoid problem with bootstrapping + case $mysql_exists { + 'true': { + if $selinux { + include mysql::selinux + } + + if $use_munin { + include mysql::munin + } + } } - - if $use_munin { - include mysql::munin - } } class mysql::server::base { @@ -41,7 +46,7 @@ class mysql::server::base { source => [ "puppet://$server/files/mysql/${fqdn}/my.cnf", "puppet://$server/files/mysql/my.cnf", - "puppet://$server/mysql/config/${operatingsystem}/my.cnf", + "puppet://$server/mysql/config/my.cnf.${operatingsystem}", "puppet://$server/mysql/config/my.cnf" ], ensure => file, @@ -73,7 +78,7 @@ class mysql::server::base { } file{'/etc/cron.d/mysql_backup.cron': - source => [ "puppet://$server/mysql/backup/${operatingsystem}/mysql_backup.cron", + source => [ "puppet://$server/mysql/backup/mysql_backup.cron.${operatingsystem}", "puppet://$server/mysql/backup/mysql_backup.cron" ], require => [ Exec[set_mysql_rootpw], File['/root/.my.cnf'] ], owner => root, group => 0, mode => 0600; diff --git a/manifests/munin.pp b/manifests/munin.pp index a7a862e..b1e9c26 100644 --- a/manifests/munin.pp +++ b/manifests/munin.pp @@ -7,16 +7,17 @@ class mysql::munin { mysql_user{'munin@localhost': password_hash => mysql_password("$munin_mysql_password"), + require => Package['mysql'], } mysql_grant{'munin@localhost': privileges => 'select_priv', - require => Mysql_user['munin@localhost'], + require => [ Mysql_user['munin@localhost'], Package['mysql'] ], } munin::plugin { [mysql_bytes, mysql_queries, mysql_slowqueries, mysql_threads]: config => "env.mysqlopts --user=munin --password=\"${munin_mysql_password}\" -h localhost", - require => [ Mysql_grant['munin@localhost'], Mysql_user['munin@localhost'] ] + require => [ Mysql_grant['munin@localhost'], Mysql_user['munin@localhost'], Package['mysql'] ] } } |