Ask Your Question
0

why does mysql_grant always fire?

asked 2014-06-12 15:39:46 -0600

Red Cricket gravatar image

updated 2014-06-13 00:21:41 -0600

Hi,

I have this bit of puppet code in an init.pp ...

    include mysql::server

    mysql_database { 'heat':
            ensure  => 'present',
    } ->

    mysql_user { 'heat@localhost':
            ensure          => 'present',
            password_hash   => '*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
    } ->

    mysql_user { 'heat@%':
            ensure          => 'present',
            password_hash   => '*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
    } ->

    mysql_grant { 'heat@localhost/heat.*':
            ensure     => 'present',
            options    => ['GRANT'],
            privileges => ['ALL'],
            table      => '*.*',
            user       => 'heat@localhost',
    }

... and when ever I run puppet apply ... I get this output ...

    Notice: /Stage[main]/Heat/Mysql_grant[heat@localhost/heat.*]/ensure: created

... I do not think it is hurting anything but it makes wonder if that grant is actually taking place since puppet feels it needs to re-execute the grant. What am I doing wrong here? I believe I am using version 2014-03-04 - Supported Release 2.2.3 of puppetlabs-mysql.

edit retag flag offensive close merge delete

Comments

Module version ?

golja gravatar imagegolja ( 2014-06-12 23:02:25 -0600 )edit

Thanks for the question golia. I updated my question. I am using 2.2.3.

Red Cricket gravatar imageRed Cricket ( 2014-06-13 00:22:13 -0600 )edit

Got same problem on 1.0.0 and 2.2.3 but only if host has some special chars (like dots fpr fqdn: localhost.localdomain, or for IP: 192.168.0.1).

nicon gravatar imagenicon ( 2014-06-13 09:27:16 -0600 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2014-06-13 09:28:05 -0600

The name of the grant must match exactly the user and table params. So your grant config should be.

    mysql_grant { 'heat@localhost/heat.*':
        ensure     => 'present',
        options    => ['GRANT'],
        privileges => ['ALL'],
        table      => 'heat.*',
        user       => 'heat@localhost',
}
edit flag offensive delete link more

Comments

Thank you sir! That does the trick.

Red Cricket gravatar imageRed Cricket ( 2014-06-13 10:56:17 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-06-12 15:39:46 -0600

Seen: 271 times

Last updated: Jun 13 '14