From 36df5326bf1cd3cccc52589390b0de1cc71ddd30 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 26 Jan 2013 12:56:03 -0200 Subject: Updating mysql_grant type with changes from the shared/riseup mysql module --- lib/puppet/type/mysql_grant.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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] -- cgit v1.2.3