example42 / puppet-mysql

Mysql Puppet Module
http://www.example42.com
Other
16 stars 38 forks source link

Specifying SQL wildcard in mysql_host param causes failures #46

Closed hundredacres closed 9 years ago

hundredacres commented 10 years ago

When specifying '%' as the mysql_host, Puppet runs error out with the following -

Notice: /Stage[main]//Mysql::Grant[db1]/Mysql::Queryfile[mysql_db_init_query_file-%-db1]/Exec[mysqlqueryfile-mysql_db_init_query_file-%-db1]/returns: ERROR 2005 (HY000): Unknown MySQL server host '%' (0) Error: mysql -u alpha --password="alpha" -h % db1 < /tmp/db1_init.sql && touch /root/puppet-mysql/mysqlqueryfile-mysql_db_init_query_file-%-db1.run returned 1 instead of one of [0] Error: /Stage[main]//Mysql::Grant[db1]/Mysql::Queryfile[mysql_db_init_query_file-%-db1]/Exec[mysqlqueryfile-mysql_db_init_query_file-%-db1]/returns: change from notrun to 0 failed: mysql -u alpha --password="alpha" -h % db1 < /tmp/db1_init.sql && touch /root/puppet-mysql/mysqlqueryfile-mysql_db_init_query_file-%-db1.run returned 1 instead of one of [0]

I was able to work around this by making the following edits -

diff --git a/manifests/grant.pp b/manifests/grant.pp index ce7ce2f..d286cc3 100644 --- a/manifests/grant.pp +++ b/manifests/grant.pp @@ -130,6 +130,7 @@ define mysql::grant ( mysql_password => $mysql_password, mysql_db => $mysql_db, mysql_host => $mysql_host,

Not sure if this is a bug though, or just an edge case I've found?

alvagante commented 10 years ago

Can you submit your change as pull request via GitHub (here is rather unreadable)

hundredacres commented 10 years ago

Done.

Thanks.

On Mar 13, 2014, at 1:48 AM, Alessandro Franceschi notifications@github.com wrote:

Can you submit your change as pull request via GitHub (here is rather unreadable)

— Reply to this email directly or view it on GitHub.

lermit commented 9 years ago

Hi @hundredacres,

Thank you for the report. This is now patched.