From c4d45c3eb5929ee27e0bd877e737303f8cf29a58 Mon Sep 17 00:00:00 2001 From: Jon Topper Date: Tue, 16 Sep 2014 15:46:13 +0100 Subject: [PATCH] Add explicit dependencies for types mysql_grant has an autorequire()'d dependency on the .my.cnf file used by the provider to talk to the database. I've added this to mysql_database and mysql_user too since logically these also need the file to be in place. I've hit this bug because of a slightly unusual edge case in our own manifests, but I think this fix belongs upstream regardless. --- lib/puppet/type/mysql_database.rb | 2 ++ lib/puppet/type/mysql_user.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/puppet/type/mysql_database.rb b/lib/puppet/type/mysql_database.rb index 3e8518c..5df4321 100644 --- a/lib/puppet/type/mysql_database.rb +++ b/lib/puppet/type/mysql_database.rb @@ -3,6 +3,8 @@ Puppet::Type.newtype(:mysql_database) do ensurable + autorequire(:file) { '/root/.my.cnf' } + newparam(:name, :namevar => true) do desc 'The name of the MySQL database to manage.' end diff --git a/lib/puppet/type/mysql_user.rb b/lib/puppet/type/mysql_user.rb index 2d059ce..759eb52 100644 --- a/lib/puppet/type/mysql_user.rb +++ b/lib/puppet/type/mysql_user.rb @@ -4,6 +4,8 @@ Puppet::Type.newtype(:mysql_user) do ensurable + autorequire(:file) { '/root/.my.cnf' } + newparam(:name, :namevar => true) do desc "The name of the user. This uses the 'username@hostname' or username@hostname." validate do |value|