Cleaned up the privilege assignment in the mysqldump backup script
This commit is contained in:
parent
49f273a42c
commit
1018a0370a
1 changed files with 11 additions and 14 deletions
|
@ -26,23 +26,20 @@ 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 {
|
||||||
|
$privs = [ 'SELECT', 'RELOAD', 'LOCK TABLES', 'SHOW VIEW', 'PROCESS' ]
|
||||||
|
}
|
||||||
|
|
||||||
mysql_grant { "${backupuser}@localhost/*.*":
|
mysql_grant { "${backupuser}@localhost/*.*":
|
||||||
ensure => $ensure,
|
ensure => $ensure,
|
||||||
user => "${backupuser}@localhost",
|
user => "${backupuser}@localhost",
|
||||||
table => '*.*',
|
table => '*.*',
|
||||||
privileges => [ 'SELECT', 'RELOAD', 'LOCK TABLES', 'SHOW VIEW', 'PROCESS' ],
|
privileges => $privs,
|
||||||
require => Mysql_user["${backupuser}@localhost"],
|
require => Mysql_user["${backupuser}@localhost"],
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
cron { 'mysql-backup':
|
cron { 'mysql-backup':
|
||||||
ensure => $ensure,
|
ensure => $ensure,
|
||||||
|
|
Loading…
Reference in a new issue