Mike Renfro
05/25/2022, 7:58 PMprofile::mariadb::mysql_procedure_grants:
- user@host/PROCEDURE db.spAddUserPermission
- user@host/PROCEDURE db.spDeactivateAllStudentsNotFlagged
and an associated profile/mariadb.pp containing in part:
class profile::mariadb (
Hash $mysql_grants,
Array $mysql_procedure_grants,
){
# ...
$mysql_procedure_grants.unique.each |String $grant_info| {
$grant_array = split($grant_info, '/')
$grant_user = $grant_array[0]
$grant_table = $grant_array[1]
$grant_hash = {
$grant_info => {
user => $grant_user,
privileges => [ 'alter routine', 'execute' ],
table => $grant_table
}
}
create_resources(mysql_grant, $grant_hash)
}
}
we seem to keep recreating the same grants over and over. Granted, I could be creating an array of hashes for a single call to create_resources, but I wouldn't think that would be the problem. Anywhere to look for narrowing down the problem? We're doing it this way to avoid massive amounts of copied/pasted privileges (the full code probably has nearly 100 procedures to be granted).