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