Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repl_slave_priv does not work as suggested in init.pp #21

Closed
LarsFronius opened this issue May 13, 2013 · 2 comments
Closed

Repl_slave_priv does not work as suggested in init.pp #21

LarsFronius opened this issue May 13, 2013 · 2 comments

Comments

@LarsFronius
Copy link
Contributor

There is a use case to set Repl_slave_priv in init.pp of puppet-percona, which unfortunately does not work.
I have written

percona::rights {'Set rights for replication':
        user     => 'repl',
        password => 'repl',
        database => ['%'],
        priv     => 'Repl_slave_priv',
        host     => '192.168.50.6',
}

in my site.pp

If I run puppet with --debug --verbose I see

Error: The privilege 'repl_slave_priv' is not valid.
Error: /Stage[main]//Node[default]/Percona::Rights[Set rights for replication]/Mysql_grant[[email protected]/%]/privileges: change from  to repl_slave_priv failed: The privilege 'repl_slave_priv' is not valid.

Seems like a validation issue in modules/percona/lib/puppet/provider/mysql_grant/mysql.rb ?!

@erik-smit
Copy link
Contributor

Good to see I'm not the only one breaking his head over this issue.

@erik-smit
Copy link
Contributor

Bingo!

mysql> describe user "Repl_slave_priv";
+-----------------+---------------+------+-----+---------+-------+
| Field           | Type          | Null | Key | Default | Extra |
+-----------------+---------------+------+-----+---------+-------+
| Repl_slave_priv | enum('N','Y') | NO   |     | N       |       |
+-----------------+---------------+------+-----+---------+-------+
1 row in set (0.00 sec)

mysql> describe db "Repl_slave_priv";
Empty set (0.00 sec)

repl_slave_priv is a privilege defined in the 'user' table.
So it can only be granted to a user.
But the example resource defines a database, so mysql_grant tries to grant it as a database-level privilege.

So it's not as obscure as I thought, but it is a good timewaster. :)
I've pullrequested a fix #30.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants