Vagrant puppetlabs-mysql Mysql_grant failed

I want to use vagrant and I have defined the following puppet file: http://pastebin.com/GfJK1ziS

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

https://github.com/puppetlabs/puppetlabs-mysql/commit/07b661dcea926981cf5cd1c703a1c982d6eb6ef1

I don't know what I need to change

+3


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}@%",
  }

      



to

  "${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.

+2


source







All Articles