diff options
Diffstat (limited to 'manifests/puppetmaster/base.pp')
-rw-r--r-- | manifests/puppetmaster/base.pp | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/manifests/puppetmaster/base.pp b/manifests/puppetmaster/base.pp index b23e386..5eb2839 100644 --- a/manifests/puppetmaster/base.pp +++ b/manifests/puppetmaster/base.pp @@ -1,39 +1,37 @@ class puppet::puppetmaster::base inherits puppet::base { File[puppet_config]{ - source => [ "puppet://$server/modules/site-puppet/master/puppet.conf", - "puppet://$server/modules/puppet/master/puppet.conf" ], - notify => Service[puppetmaster], + source => [ "puppet://$server/modules/site-puppet/master/puppet.conf", + "puppet://$server/modules/puppet/master/puppet.conf" ], + notify => Service[puppetmaster], } - $real_puppet_fileserverconfig = $puppet_fileserverconfig ? { - '' => "/etc/puppet/fileserver.conf", - default => $puppet_fileserverconfig, - } + if !$puppet_fileserverconfig { $puppet_fileserverconfig = '/etc/puppet/fileserver.conf' } - file { "$real_puppet_fileserverconfig": - source => [ "puppet://$server/modules/site-puppet/master/${fqdn}/fileserver.conf", - "puppet://$server/modules/site-puppet/master/fileserver.conf", - "puppet://$server/modules/puppet/master/fileserver.conf" ], - notify => [Service[puppet],Service[puppetmaster] ], - owner => root, group => puppet, mode => 640; - } + file { "$puppet_fileserverconfig": + source => [ "puppet://$server/modules/site-puppet/master/${fqdn}/fileserver.conf", + "puppet://$server/modules/site-puppet/master/fileserver.conf", + "puppet://$server/modules/puppet/master/fileserver.conf" ], + notify => [ Service[puppet],Service[puppetmaster] ], + owner => root, group => puppet, mode => 640; + } - if $puppetmaster_storeconfigs { - include puppet::puppetmaster::storeconfigs - } + if $puppetmaster_storeconfigs { + include puppet::puppetmaster::storeconfigs + } - if ! defined (puppet::puppetmaster::passenger) { - # restart the master from time to time to avoid memory problems - file{'/etc/cron.d/puppetmaster.cron': + if ! defined (puppet::puppetmaster::passenger) { + # restart the master from time to time to avoid memory problems + file{'/etc/cron.d/puppetmaster.cron': source => [ "puppet://$server/modules/puppet/cron.d/puppetmaster.${operatingsystem}", - "puppet://$server/modules/puppet/cron.d/puppetmaster" ], + "puppet://$server/modules/puppet/cron.d/puppetmaster" ], owner => root, group => 0, mode => 0644; - } - } + } + } - file{'/etc/cron.daily/puppet_reports_cleanup.sh': - content => "#!/bin/bash\nfind /var/log/puppet/reports/ -maxdepth 2 -type f -ctime +30 -exec rm {} \\;\n", - owner => root, group => 0, mode => 0700; - } + # clean up reports older than 30 days + file{'/etc/cron.daily/puppet_reports_cleanup.sh': + content => "#!/bin/bash\nfind /var/log/puppet/reports/ -maxdepth 2 -type f -ctime +30 -exec rm {} \\;\n", + owner => root, group => 0, mode => 0700; + } } |