summaryrefslogtreecommitdiff
path: root/manifests/puppetmaster/base.pp
blob: 0b208b0273d387719601d05687ab24ec2999c7d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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[puppet],Service[puppetmaster] ],
    }

    $real_puppet_fileserverconfig = $puppet_fileserverconfig ? {
        '' => "/etc/puppet/fileserver.conf",
        default => $puppet_fileserverconfig,
    }

    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;
    }

    if $puppetmaster_storeconfigs {
        include puppet::puppetmaster::storeconfigs
    }

    # 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" ],
        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;
    }
}