diff options
Diffstat (limited to 'manifests/server/cron')
-rw-r--r-- | manifests/server/cron/backup.pp | 19 | ||||
-rw-r--r-- | manifests/server/cron/optimize.pp | 6 |
2 files changed, 15 insertions, 10 deletions
diff --git a/manifests/server/cron/backup.pp b/manifests/server/cron/backup.pp index 33b8f0f..c1e84d1 100644 --- a/manifests/server/cron/backup.pp +++ b/manifests/server/cron/backup.pp @@ -5,18 +5,23 @@ class mysql::server::cron::backup { default => $mysql_backup_dir, } - file { 'mysql_backup_dir': - path => $real_mysql_backup_dir, - source => "puppet://${server}/modules/common/empty", - ensure => directory, - owner => root, group => 0, mode => 0700, + case $mysql_manage_backup_dir { + false: { info("We don't manage \$mysql_backup_dir ($mysql_backup_dir)") } + default: { + file { 'mysql_backup_dir': + path => $real_mysql_backup_dir, + ensure => directory, + before => Cron['mysql_backup_cron'], + owner => root, group => 0, mode => 0700; + } + } } cron { 'mysql_backup_cron': - command => '/usr/bin/mysqldump --default-character-set=utf8 --all-databases --all --flush-logs --lock-tables --single-transaction | gzip > ${real_mysql_backup_dir}/mysqldump.sql.gz && chmod 600 ${real_mysql_backup_dir}/mysqldump.sql.gz', + command => "/usr/bin/mysqldump --default-character-set=utf8 --all-databases --all --flush-logs --lock-tables --single-transaction | gzip > ${real_mysql_backup_dir}/mysqldump.sql.gz && chmod 600 ${real_mysql_backup_dir}/mysqldump.sql.gz", user => 'root', minute => 0, hour => 1, - require => [ Exec['mysql_set_rootpw'], File['mysql_root_cnf'], File['mysql_backup_dir'] ], + require => [ Exec['mysql_set_rootpw'], File['mysql_root_cnf'] ], } } diff --git a/manifests/server/cron/optimize.pp b/manifests/server/cron/optimize.pp index 29ee66e..c238930 100644 --- a/manifests/server/cron/optimize.pp +++ b/manifests/server/cron/optimize.pp @@ -1,13 +1,13 @@ class mysql::server::cron::optimize { file { 'mysql_optimize_script': - path => "${mysql_moduledir}/server/optimize_tables.rb", - source => "puppet://${server}/modules/mysql/scripts/optimize_tables.rb", + path => '/usr/local/sbin/optimize_mysql_tables.rb', + source => "puppet:///modules/mysql/scripts/optimize_tables.rb", owner => root, group => 0, mode => 0700; } cron { 'mysql_optimize_cron': - command => "${mysql_moduledir}/server/optimize_tables.rb", + command => '/usr/local/sbin/optimize_mysql_tables.rb', user => 'root', minute => 40, hour => 6, |