From ee94a2a56c73dc54439b34a58320c8c233ccdbd7 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 18 Oct 2007 11:54:23 +0200 Subject: mysql: flush privileges, autorequire, minor adjustments This commit executes a mysqladmin flush-privileges after every modification of users or grants, thereby enabling mysql to actually look at the changes too. grants now autorequire the appropriate db and user adjustet my site.pp for new types --- plugins/puppet/provider/mysql_grant/mysql.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'plugins/puppet/provider/mysql_grant/mysql.rb') diff --git a/plugins/puppet/provider/mysql_grant/mysql.rb b/plugins/puppet/provider/mysql_grant/mysql.rb index 9d900ec..93d7ecf 100644 --- a/plugins/puppet/provider/mysql_grant/mysql.rb +++ b/plugins/puppet/provider/mysql_grant/mysql.rb @@ -10,6 +10,11 @@ Puppet::Type.type(:mysql_grant).provide(:mysql) do desc "Uses mysql as database." commands :mysql => '/usr/bin/mysql' + commands :mysqladmin => '/usr/bin/mysqladmin' + + def mysql_flush + mysqladmin "flush-privileges" + end # this parses the def split_name(string) @@ -44,6 +49,7 @@ Puppet::Type.type(:mysql_grant).provide(:mysql) do name[:host], name[:user], name[:db], ] end + mysql_flush end end @@ -129,6 +135,7 @@ Puppet::Type.type(:mysql_grant).provide(:mysql) do stmt = stmt << set << where mysql "mysql", "-Be", stmt + mysql_flush end end -- cgit