Skip to content

Commit

Permalink
Fix the mysql_grant call to not fail with puppetlabs-mysql 2.3
Browse files Browse the repository at this point in the history
Due to a recent change in puppetlabs-mysql, the "host_access" call in
manifests/db/mysql/host_access.pp of the current puppet-ceilometer
module doesn't work anymore. The problem is obvious -- this is the
actual code:

    mysql_grant { "${user}@${name}/${database}":
      privileges => 'all',
      provider => 'mysql',
      table => "${database}.*",
      user => "${user}@${name}",
      require => Mysql_user["${user}@${name}"]
    }

As you will notice, mysql_grant now performs this check (as in
puppetlabs/puppetlabs-mysql@07b661d):

fail('name must match user and table parameters') if self[:name] != "#{self[:user]}/#{self[:table]}

The problem here is that "${database}" is not equal to "${database}.*",
which will make the mysql_grant call fail. The fix simply is to change
the function's name:

    mysql_grant { "${user}@${name}/${database}.*":
      privileges => 'all',
      provider => 'mysql',
      table => "${database}.*",
      user => "${user}@${name}",
      require => Mysql_user["${user}@${name}"]
    }

This commit conducts the proposed change.

Change-Id: Ic9457cb8ad96a0d39f7a29d3e593e788bbeb6d28
Closes-Bug: 1375233
  • Loading branch information
Martin Gerhard Loschwitz committed Sep 29, 2014
1 parent 43ad685 commit 0d72487
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/db/mysql/host_access.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
require => Mysql_database[$database],
}

mysql_grant { "${user}@${name}/${database}":
mysql_grant { "${user}@${name}/${database}.*":
privileges => 'all',
provider => 'mysql',
table => "${database}.*",
Expand Down

0 comments on commit 0d72487

Please sign in to comment.