Plugin | convert_grants_to_resources |
In: |
/vagrant/modules/undine_percona/lib/puppet/parser/functions/convert_grants_to_resources.rb
|
A helper function used by Undine to convert a hash of arrays in database => permissions format to a hash of hashes to be converted to exec resources for a given username.
Returns a hash of hashes compatible with create_resources(exec, …) representing the permissions granted to username for each database named in grants.
GRANTs the CREATE, UPDATE, and DELETE permissions on my_database to my_user.
$grants = { 'my_database' => [ 'CREATE', 'UPDATE', 'DELETE', ], } $exec_hash = convert_grants_to_resources('my_user', $grants) create_resources(exec, $exec_hash)