From 5eddd2d2d48f51f9694c6e3fc49241b3f134b612 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 25 Jan 2013 15:45:46 -0200 Subject: Puppet update; adding storeconfig block --- manifests/master.pp | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'manifests/master.pp') diff --git a/manifests/master.pp b/manifests/master.pp index 3b02195..1c4abfa 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -1,5 +1,6 @@ class nodo::master { - $main_master = hiera('nodo::master::main', false) + $main_master = hiera('nodo::master::main', false) + $master_db_password = hiera('nodo::master::db_password', '') if $main_master == true { # Puppetmaster should be included before nodo::vserver @@ -40,13 +41,31 @@ class nodo::master { ensure => absent, } - case $puppetmaster_db_password { - '': { fail("Please set \$puppetmaster_db_password in your host config") } + # For storeconfigs + include mysql::server + + # Database creation as suggested by + # http://reductivelabs.com/trac/puppet/wiki/Recipes/MySQLStoredConfiguration + #exec { "create-storeconfigs-db": + # command => "/usr/bin/mysqladmin create puppet", + # unless => "/usr/bin/mysqlcheck -s puppet", + # notify => Exec["create-storeconfigs-user"], + #} + # + #$cmd = "/usr/bin/mysql -e 'grant all privileges on puppet.* to puppet@localhost identified by \"puppet\"'" + # + #exec { "create-storeconfigs-user": + # command => $cmd, + # refreshonly => true, + #} + + case $master_db_password { + '': { fail("Please set nodo::master::db_password in your config") } } # Update master's puppet.conf if you change here database::instance { "puppet": - password => "$puppetmaster_db_password", + password => "$db_password", } # Used for trac dependency graphs -- cgit v1.2.3