diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2009-12-30 15:42:55 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2009-12-30 15:42:55 -0200 |
commit | 5c73c32c08f22cc57eb48812591e119fbb14b457 (patch) | |
tree | 593203121f646ca91166dcd27781177e1a3d167f /manifests/puppetmasterd.pp | |
download | puppet-puppet-5c73c32c08f22cc57eb48812591e119fbb14b457.tar.gz puppet-puppet-5c73c32c08f22cc57eb48812591e119fbb14b457.tar.bz2 |
Initial import
Diffstat (limited to 'manifests/puppetmasterd.pp')
-rw-r--r-- | manifests/puppetmasterd.pp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/manifests/puppetmasterd.pp b/manifests/puppetmasterd.pp new file mode 100644 index 0000000..c12082e --- /dev/null +++ b/manifests/puppetmasterd.pp @@ -0,0 +1,62 @@ +# handles puppetmasterd service + +# warns that this node has a puppetmaster +$puppetmasterd_present = true + +class puppetmasterd inherits puppet { + + # needed packages + package { + "puppetmaster": ensure => installed; + "sqlite3": ensure => installed; + } + + # for storeconfigs + include mysql::server + + service { "puppetmaster": + enable => true, + ensure => running, + hasrestart => true, + } + + # cron rule to update puppet config repository every 5 minutes + cron { "puppet-update": + command => "/usr/local/sbin/update-puppet-conf.sh &> /dev/null", + user => puppet, + minute => "*/5", + ensure => present, + require => [ File["/usr/local/sbin/update-puppet-conf.sh"], User["puppet"] ], + } + + # cron rule to restart puppetmaster before restarting the nodes + cron { "puppetmaster-restart": + command => "/etc/init.d/puppetmaster restart &> /dev/null", + user => root, + hour => "*/1", + minute => "0", + ensure => absent, + } + + # and the script to the cron-job above + file { "/usr/local/sbin/update-puppet-conf.sh": + source => "puppet://$server/modules/puppet/update-puppet-conf.sh", + owner => "puppet", + group => "puppet", + mode => 0755, + ensure => present, + } + + # TODO: 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"], + #} + #exec { "create-storeconfigs-user": + # command => "/usr/bin/mysql -e 'grant all privileges on puppet.* to puppet@localhost identified by \"puppet\"'", + # refreshonly => true, + #} + +} |