first stab at making puppet figure out info for nagios and munin master
[mirror/dsa-puppet.git] / manifests / site.pp
1 Package {
2     require => File["/etc/apt/apt.conf.d/local-recommends"]
3 }
4
5 File {
6     owner   => root,
7     group   => root,
8     mode    => 444,
9     ensure  => file,
10 }
11
12 Exec {
13     path => "/usr/bin:/usr/sbin:/bin:/sbin"
14 }
15
16 node default {
17     $localinfo = yamlinfo('*', "/etc/puppet/modules/debian-org/misc/local.yaml")
18     $nodeinfo  = nodeinfo($fqdn, "/etc/puppet/modules/debian-org/misc/local.yaml")
19     $hoster    = whohosts($nodeinfo, "/etc/puppet/modules/debian-org/misc/hoster.yaml")
20     notice("hoster for ${fqdn} is ${hoster}")
21
22     $mxinfo   = allnodeinfo("mXRecord")
23
24     include munin-node
25     include sudo
26     include ssh
27     include debian-org
28     include monit
29     include apt-keys
30     include ntp
31
32     include motd
33     include samhain
34
35     case $smartarraycontroller {
36         "true":    { include debian-proliant }
37     }
38     case $kvmdomain {
39         "true":    { package { acpid: ensure => installed } }
40     }
41
42     case $mta {
43         "exim4":   {
44              case extractnodeinfo($nodeinfo, 'heavy_exim') {
45                   "true":  { include exim::mx }
46                   default: { include exim }
47              }
48         }
49     }
50
51     case extractnodeinfo($nodeinfo, 'muninmaster') {
52         "true": {
53                       include munin-node::master
54         }
55     }
56
57     case extractnodeinfo($nodeinfo, 'nagiosmaster') {
58         "true": {
59                       include nagios::server
60         }
61         default: {
62                       include nagios::client
63         }
64     }
65
66     case $apache2 {
67          "true":  {
68               case extractnodeinfo($nodeinfo, 'apache2_security_mirror') {
69                      "true":  { include apache2::security_mirror }
70                      default: { include apache2 }
71               }
72          }
73     }
74
75     case extractnodeinfo($nodeinfo, 'buildd') {
76          "true":  { include buildd }
77     }
78
79     case $hostname {
80         klecker,ravel,senfl,orff: { include named::secondary }
81     }
82
83     case $hostname {
84         logtest01: { include ferm }
85     }
86     case $hostname {
87         geo1,geo2,geo3: { include named::geodns }
88     }
89     case $brokenhosts {
90         "true":    { include hosts }
91     }
92     case $hoster {
93         "ubcece", "darmstadt", "ftcollins", "grnet":  { include resolv }
94     }
95 }