diff options
author | mh <mh@immerda.ch> | 2009-10-02 13:48:31 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2009-10-02 13:48:31 +0200 |
commit | 76fbba7c159866025b9fd99fe68ebf7512c31c2c (patch) | |
tree | f5658e09fb266cfe88c13d9ce3f2c190f56a6525 /manifests/puppetmaster/hasdb | |
parent | b96c7630ffc98504d166e1f59ffa878bd9c9c447 (diff) |
refactor everything into its own file
Diffstat (limited to 'manifests/puppetmaster/hasdb')
-rw-r--r-- | manifests/puppetmaster/hasdb/mysql.pp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/manifests/puppetmaster/hasdb/mysql.pp b/manifests/puppetmaster/hasdb/mysql.pp new file mode 100644 index 0000000..51fd776 --- /dev/null +++ b/manifests/puppetmaster/hasdb/mysql.pp @@ -0,0 +1,31 @@ +# don't use this define use the general interface +define puppet::puppetmaster::hasdb::mysql( + $dbname = 'puppet', + $dbhost = 'localhost', + $dbhostfqdn = "${fqdn}", + $dbuser = 'puppet', + $dbpwd, + $dbconnectinghost = 'localhost' +){ + @@mysql_database{$dbname: + tag => "mysql_${dbhostfqdn}", + } + + @@mysql_user{"${dbuser}@${dbconnectinghost}": + password_hash => mysql_password("$dbpwd"), + require => Mysql_database[$dbname], + tag => "mysql_${dbhostfqdn}", + } + + + @@mysql_grant{"${dbuser}@${dbconnectinghost}/${dbname}": + privileges => all, + require => Mysql_user["${dbuser}@${dbconnectinghost}"], + tag => "mysql_${dbhostfqdn}", + } + + munin::plugin::deploy{'puppetresources': + source => "puppet/munin/puppetresources.mysql", + config => "env.mysqlopts --user=$dbuser --password=$dbpwd -h $dbhost\nenv.puppetdb $dbname", + } +} |