take hiera out of the params
This commit is contained in:
parent
956edf58cc
commit
59ec83a3cc
1 changed files with 14 additions and 18 deletions
|
@ -1,22 +1,18 @@
|
|||
class mysql::server::cron::backup {
|
||||
$mysql_backup_dir = hiera('mysql_backup_dir','/var/backups/mysql')
|
||||
case hiera('mysql_manage_backup_dir',true) {
|
||||
false: { info("We don't manage the mysql_backup_dir") }
|
||||
default: {
|
||||
file { 'mysql_backup_dir':
|
||||
path => $mysql_backup_dir,
|
||||
ensure => directory,
|
||||
before => Cron['mysql_backup_cron'],
|
||||
owner => root, group => 0, mode => 0700;
|
||||
}
|
||||
}
|
||||
if $mysql::server::manage_backup_dir
|
||||
file { 'mysql_backup_dir':
|
||||
path => $mysql::server::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 --create-options --flush-logs --lock-tables --single-transaction | gzip > ${mysql_backup_dir}/mysqldump.sql.gz && chmod 600 ${mysql_backup_dir}/mysqldump.sql.gz",
|
||||
user => 'root',
|
||||
minute => 0,
|
||||
hour => 1,
|
||||
require => [ Exec['mysql_set_rootpw'], File['mysql_root_cnf'] ],
|
||||
}
|
||||
cron { 'mysql_backup_cron':
|
||||
command => "/usr/bin/mysqldump --default-character-set=utf8 --all-databases --create-options --flush-logs --lock-tables --single-transaction | gzip > ${mysql::server::backup_dir}/mysqldump.sql.gz && chmod 600 ${mysql::server::backup_dir}/mysqldump.sql.gz",
|
||||
user => 'root',
|
||||
minute => 0,
|
||||
hour => 1,
|
||||
require => [ Exec['mysql_set_rootpw'], File['mysql_root_cnf'] ],
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue