> I found a github reference to a package that might do it 
> (http://github.com/camptocamp/puppet-mysql) but I can't understand
> what it is, how it works, or even what to do with it.

Hmm. How familiar are you with puppet modules? Not quite clear how
detailed we need to be here :-). Here is a doc that outlines them:
http://docs.puppetlabs.com/guides/modules.html

Ordinarily you would drop this code into your 'module path' (by
default this is often /etc/puppet/modules). This would make it
available then for use in other code/manifests.

Assuming you are already okay with these aspects of puppet - here is a
sample manifest on how to use it for 1 system. I have a fork of that
code (its been around - I'm not even clear who wrote it first - could
have been David Schmidt: http://git.black.co.at/?p=module-mysql;a=summary)
so it may not work exactly the same :-).

        mysql_database {
                "drupal":
                        ensure => present;
                "bugzilla":
                        ensure => present;
                "wpmu":
                        ensure => present;
        }
        mysql_user {
                "dru...@localhost":
                        password_hash => mysql_password("foo");
                "bugzi...@localhost":
                        password_hash => mysql_password("foo");
                "w...@localhost":
                        password_hash => mysql_password("foo");
        }
        mysql_grant {
                "dru...@localhost/drupal":
                        privileges => [
                                "select_priv", "insert_priv",
"update_priv", "delete_priv",
                                "create_priv", "drop_priv",
"index_priv", "alter_priv",
                        ],
                        require => Mysql_user["dru...@localhost"];
                "bugzi...@localhost/bugzilla":
                        privileges => [
                                "select_priv", "insert_priv",
"update_priv", "delete_priv",
                                "create_priv", "drop_priv",
"index_priv", "alter_priv",
                        ],
                        require => Mysql_user["bugzi...@localhost"];
                "w...@localhost/wpmu":
                        privileges => [
                                "select_priv", "insert_priv",
"update_priv", "delete_priv",
                                "create_priv", "drop_priv",
"index_priv", "alter_priv",
                        ],
                        require => Mysql_user["w...@localhost"];
        }

This would in effect:

* create 3 databases - drupal, bugzilla, wpmu
* create 3 users - drupal, bugzilla, wpmu
* assign grant access for the users to the db's of the same name

ken.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to