Cleaned up the privilege assignment in the mysqldump backup script

This commit is contained in:
Steven C. Saliman 2015-04-30 14:21:08 -06:00
parent 49f273a42c
commit 1018a0370a

View file

@ -26,23 +26,20 @@ class mysql::backup::mysqldump (
require => Class['mysql::server::root_password'],
}
if $include_triggers {
mysql_grant { "${backupuser}@localhost/*.*":
ensure => $ensure,
user => "${backupuser}@localhost",
table => '*.*',
privileges => [ 'SELECT', 'RELOAD', 'LOCK TABLES', 'SHOW VIEW', 'PROCESS', 'TRIGGER' ],
require => Mysql_user["${backupuser}@localhost"],
}
$privs = [ 'SELECT', 'RELOAD', 'LOCK TABLES', 'SHOW VIEW', 'PROCESS', 'TRIGGER' ]
} else {
$privs = [ 'SELECT', 'RELOAD', 'LOCK TABLES', 'SHOW VIEW', 'PROCESS' ]
}
mysql_grant { "${backupuser}@localhost/*.*":
ensure => $ensure,
user => "${backupuser}@localhost",
table => '*.*',
privileges => [ 'SELECT', 'RELOAD', 'LOCK TABLES', 'SHOW VIEW', 'PROCESS' ],
privileges => $privs,
require => Mysql_user["${backupuser}@localhost"],
}
}
cron { 'mysql-backup':
ensure => $ensure,