From: Silvio Rhatto Date: Sat, 26 Jan 2013 14:56:03 +0000 (-0200) Subject: Updating mysql_grant type with changes from the shared/riseup mysql module X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=36df5326bf1cd3cccc52589390b0de1cc71ddd30;p=puppet-mysql.git Updating mysql_grant type with changes from the shared/riseup mysql module --- diff --git a/lib/puppet/type/mysql_grant.rb b/lib/puppet/type/mysql_grant.rb index 29ae222..c6311e5 100644 --- a/lib/puppet/type/mysql_grant.rb +++ b/lib/puppet/type/mysql_grant.rb @@ -1,7 +1,19 @@ # This has to be a separate type to enable collecting Puppet::Type.newtype(:mysql_grant) do @doc = "Manage a database user's rights." + #ensurable + autorequire(:service) { 'mysqld' } + + autorequire :mysql_table do + reqs = [] + matches = self[:name].match(/^([^@]*)@([^\/]*)\/(.+)\/(.+)$/) + unless matches.nil? + reqs << matches[4] + end + # puts "Autoreq: '%s'" % reqs.join(" ") + reqs + end autorequire :mysql_db do # puts "Starting db autoreq for %s" % self[:name]