diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-01-26 12:56:03 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-01-26 12:56:03 -0200 |
commit | 36df5326bf1cd3cccc52589390b0de1cc71ddd30 (patch) | |
tree | 8202cd751a5be15aa1149d653e313b853efac4f3 /lib/puppet | |
parent | 0c56fe190749cb96e152e41d9c9788c7395cfa3c (diff) | |
download | puppet-mysql-36df5326bf1cd3cccc52589390b0de1cc71ddd30.tar.gz puppet-mysql-36df5326bf1cd3cccc52589390b0de1cc71ddd30.tar.bz2 |
Updating mysql_grant type with changes from the shared/riseup mysql module
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/type/mysql_grant.rb | 12 |
1 files changed, 12 insertions, 0 deletions
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] |