Vagrant puppetlabs-mysql Mysql_grant failed

I want to use vagrant and I have defined the following puppet file:

When the vagrant tries to install the modules, everything works as expected. But when he tries to configure mysql

, he always gets this error:

 Error: Validation of Mysql_grant[${username}@%/${db_name}.*] failed: name must match user and table parameters


What can I do?

As far as I can tell from this line in the module puppetlabs_mysql

I don't know what I need to change


source to share

1 answer

There is a problem with the definition mysql_grants

. It fails in the following test:

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


The error message explains exactly what is wrong. The grant resource name must match user

and table

. So change:

  '${username}@%/${db_name}.*' => {
    table      => "${db_name}.*",
    user       => "${username}@%",



  "${username}@%/${db_name}.*" => {
    table      => "${db_name}.*",
    user       => "${username}@%",


Single string quotes do not interpolate variables in the puppet.

UPDATE: There are also many style issues. You are mixing single quotes with double quotes. Use puppet-lint to improve the style of your code.



All Articles