diff options
Diffstat (limited to 'manifests/base.pp')
-rw-r--r-- | manifests/base.pp | 64 |
1 files changed, 36 insertions, 28 deletions
diff --git a/manifests/base.pp b/manifests/base.pp index 6ff8fa5..5cb4c5d 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -1,42 +1,50 @@ +# configure general things of puppet class puppet::base { - if !$puppet_config { $puppet_config = '/etc/puppet/puppet.conf' } - - $puppet_majorversion = regsubst($puppetversion,'^(\d+\.\d+).*$','\1') - - case $puppet_cleanup_clientbucket { + $puppet_majorversion = regsubst($::puppetversion,'^(\d+\.\d+).*$','\1') + case $puppet::cleanup_clientbucket { # if not set, don't do anything - '',undef: {} - default: { - tidy { "/var/lib/puppet/clientbucket": - backup => false, + '',undef,false: {} + default: { + tidy { '/var/lib/puppet/clientbucket': + backup => false, recurse => true, - rmdirs => true, - type => mtime, - age => "$puppet_cleanup_clientbucket"; + rmdirs => true, + type => mtime, + age => $puppet::cleanup_clientbucket; } } } file { 'puppet_config': - path => "$puppet_config", - source => [ "puppet:///modules/site_puppet/client/${fqdn}/puppet.conf", - "puppet:///modules/site_puppet/client/puppet.conf.$operatingsystem", - "puppet:///modules/site_puppet/client/puppet.conf", - "puppet:///modules/puppet/client/${puppet_majorversion}/puppet.conf.$operatingsystem", - "puppet:///modules/puppet/client/${puppet_majorversion}/puppet.conf", - "puppet:///modules/puppet/client/puppet.conf.$operatingsystem", - "puppet:///modules/puppet/client/puppet.conf" ], - notify => Service[puppet], - # if puppetmasterd is deployed by apache2/passenger it needs to read puppet.conf - # therefore it must be readable by puppet - owner => puppet, group => 0, mode => 600; + path => $puppet::config, + notify => Service[puppet], + # if puppetmasterd is deployed by apache2/passenger it needs + # to read puppet.conf. therefore it must be readable by puppet + owner => puppet, + group => 0, + mode => '0600'; + } + if $puppet::config_content { + File['puppet_config'] { + content => $puppet::config_content + } + } else { + File['puppet_config'] { + source => [ "puppet:///modules/site_puppet/client/${::fqdn}/puppet.conf", + "puppet:///modules/site_puppet/client/puppet.conf.${::operatingsystem}", + 'puppet:///modules/site_puppet/client/puppet.conf', + "puppet:///modules/puppet/client/${puppet_majorversion}/puppet.conf.${::operatingsystem}", + "puppet:///modules/puppet/client/${puppet_majorversion}/puppet.conf", + "puppet:///modules/puppet/client/puppet.conf.${::operatingsystem}", + 'puppet:///modules/puppet/client/puppet.conf' ] + } } service { 'puppet': - ensure => running, - enable => true, - hasstatus => true, - hasrestart => true, + ensure => running, + enable => true, + hasstatus => true, + hasrestart => true, } } |