X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=manifests%2Fsite.pp;h=d7a965dddee7e3c7b57cb9b8b0c4b2882f25f82f;hb=d06497885ecd69ba03a8c838c3ff6a4499821b44;hp=272b5647a7f3a226437d1867b3fef4fbb563ceb7;hpb=b2eac2cf639c4e5b4632fc09ccd19c244649445b;p=mirror%2Fdsa-puppet.git diff --git a/manifests/site.pp b/manifests/site.pp index 272b5647a..d7a965ddd 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -15,199 +15,143 @@ Exec { node default { $localinfo = yamlinfo('*', "/etc/puppet/modules/debian-org/misc/local.yaml") - $nodeinfo = nodeinfo($fqdn, "/etc/puppet/modules/debian-org/misc/local.yaml") - $hoster = whohosts($nodeinfo, "/etc/puppet/modules/debian-org/misc/hoster.yaml") - $keyinfo = allnodeinfo("sshRSAHostKey", "ipHostNumber") - notice("hoster for ${fqdn} is ${hoster}") - - $mxinfo = allnodeinfo("mXRecord") + $nodeinfo = nodeinfo($::fqdn, "/etc/puppet/modules/debian-org/misc/local.yaml") + $allnodeinfo = allnodeinfo("sshRSAHostKey ipHostNumber", "purpose mXRecord physicalHost purpose") + notice( sprintf("hoster for %s is %s", $::fqdn, getfromhash($nodeinfo, 'hoster', 'name') ) ) include munin-node + include syslog-ng include sudo include ssh include debian-org include monit include apt-keys include ntp + include ntpdate include ssl - include motd - case $hostname { + case $::hostname { finzi,fano,fasch,field: { include kfreebsd } } - case $smartarraycontroller { - "true": { include debian-proliant } + if $::smartarraycontroller { + include debian-proliant } - case $kvmdomain { - "true": { package { acpid: ensure => installed } } + + if $::productname == 'PowerEdge 2850' { + include megactl + } + + if $::mptraid { + include raidmpt } - case $mptraid { - "true": { include "raidmpt" } + + if $::kvmdomain { + include acpi } - case $mta { - "exim4": { - case extractnodeinfo($nodeinfo, 'heavy_exim') { - 'true': { include exim::mx } - default: { include exim } - } + if $::mta == 'exim4' { + case getfromhash($nodeinfo, 'heavy_exim') { + true: { include exim::mx } + default: { include exim } } } - case extractnodeinfo($nodeinfo, 'muninmaster') { - true: { include munin-node::master } + if getfromhash($nodeinfo, 'puppetmaster') { + include puppetmaster + } + + if getfromhash($nodeinfo, 'muninmaster') { + include munin-node::master } - case extractnodeinfo($nodeinfo, 'nagiosmaster') { + case getfromhash($nodeinfo, 'nagiosmaster') { true: { include nagios::server } default: { include nagios::client } } - case $apache2 { - "true": { - case extractnodeinfo($nodeinfo, 'apache2_security_mirror') { - true: { include apache2::security_mirror } - default: { include apache2 } - } + if $::apache2 { + if getfromhash($nodeinfo, 'apache2_security_mirror') { + include apache2::security_mirror + } + if getfromhash($nodeinfo, 'apache2_www_mirror') { + include apache2::www_mirror + } + if getfromhash($nodeinfo, 'apache2_backports_mirror') { + include apache2::backports_mirror } + if getfromhash($nodeinfo, 'apache2_ftp-upcoming_mirror') { + include apache2::ftp-upcoming_mirror + } + include apache2 } - case extractnodeinfo($nodeinfo, 'buildd') { - 'true': { - include buildd - case $kernel { - Linux: { - include ferm - } - } - } + if $::rsyncd { + include rsyncd-log } - case $hostname { - klecker,ravel,senfl,orff: { include named::secondary } - geo1,geo2,geo3: { include named::geodns } - bartok,schein,steffani,franck: { include named::recursor } + + if getfromhash($nodeinfo, 'buildd') { + include buildd } - case $hostname { - franck,powell,logtest01,geo1,geo2,geo3,bartok,senfl,beethoven,piatti,saens,villa,lobos,raff,gluck,schein,wieck,steffani,ball,handel,tchaikovsky,heininen,nielsen,kokkonen,kaufmann: { include ferm } + case $::hostname { + ravel,senfl,orff,draghi,diamond: { include named::authoritative } + geo1,geo2,geo3: { include named::geodns } + liszt: { include named::recursor } } - case $hostname { - agricola,albeniz,gabrielli,merulo,paer,pergolesi,pescetti,smetana,sperger,zee,zelenka: { include ferm } + case $::hostname { + franck,master,lobos,samosa,spohr,widor: { include unbound } } - case $hostname { - orff,duarte,soler,lindberg,morricone,respighi,scelsi,valente,vitry,vivaldi,wolkenstein: { include ferm } + + if $::lsbdistcodename != 'lenny' { + include unbound } - case $hostname { - zandonai,zelenka: { - @ferm::rule { "dsa-zivit-rrdcollect": - description => "port 6666 for rrdcollect for zivit", - rule => "&SERVICE_RANGE(tcp, 6666, ( 10.130.18.71 ))" - } - @ferm::rule { "dsa-zivit-zabbix": - description => "port 10050 for zabbix for zivit", - rule => "&SERVICE_RANGE(tcp, 10050, ( 10.130.18.76 ))" - } - } - piatti: { - @ferm::rule { "dsa-udd-stunnel": - description => "port 8080 for udd stunnel", - rule => "&SERVICE_RANGE(tcp, http-alt, ( 192.25.206.16 70.103.162.29 217.196.43.134 ))" - } - } - senfl: { - @ferm::rule { "dsa-rsync": - domain => "(ip ip6)", - description => "Allow rsync access", - rule => "&SERVICE(tcp, 873)" - } - } - saens,villa,lobos,raff,gluck,schein,wieck,steffani,franck,morricone: { - @ferm::rule { "dsa-ftp": - domain => "(ip ip6)", - description => "Allow ftp access", - rule => "&SERVICE(tcp, 21)" - } - @ferm::rule { "dsa-rsync": - domain => "(ip ip6)", - description => "Allow rsync access", - rule => "&SERVICE(tcp, 873)" - } - } - ancina,zelenka: { - @ferm::rule { "dsa-time": - description => "Allow time access", - rule => "&SERVICE_RANGE(tcp, time, \$HOST_NAGIOS_V4)" - } - } - handel: { - @ferm::rule { "dsa-puppet": - description => "Allow puppet access", - rule => "&SERVICE_RANGE(tcp, 8140, \$HOST_DEBIAN_V4)" - } - @ferm::rule { "dsa-puppet-v6": - domain => 'ip6', - description => "Allow puppet access", - rule => "&SERVICE_RANGE(tcp, 8140, \$HOST_DEBIAN_V6)" - } - } - powell: { - @ferm::rule { "dsa-powell-v6-tunnel": - description => "Allow powell to use V6 tunnel broker", - rule => "proto ipv6 saddr 212.227.117.6 jump ACCEPT" - } - @ferm::rule { "dsa-powell-btseed": - domain => "(ip ip6)", - description => "Allow powell to seed BT", - rule => "proto tcp dport 8000:8100 jump ACCEPT" - } - @ferm::rule { "dsa-powell-rsync": - description => "Hoster wants to sync from here, and why not", - rule => "&SERVICE_RANGE(tcp, rsync, ( 195.20.242.90 192.25.206.33 82.195.75.106 206.12.19.118 ))" - } - } - beethoven: { - @ferm::rule { "dsa-merikanto-beethoven": - description => "Allow merikanto", # for nfs, and that uses all kind of ports by default. - rule => "source 172.22.127.147 interface bond0 jump ACCEPT", - } - } - heininen: { - @ferm::rule { "dsa-syslog": - description => "Allow syslog access", - rule => "&SERVICE_RANGE(tcp, 5140, \$HOST_DEBIAN_V4)" - } - @ferm::rule { "dsa-syslog-v6": - domain => 'ip6', - description => "Allow syslog access", - rule => "&SERVICE_RANGE(tcp, 5140, \$HOST_DEBIAN_V6)" - } + include resolv + + if $::kernel == 'Linux' { + include ferm + include ferm::per-host + } + + case $::hostname { + diabelli,nono,spohr: { include dacs } + } + + case $::hostname { + beethoven,duarte,spohr,stabile: { + include nfs-server } - kaufmann: { - @ferm::rule { "dsa-hkp": - domain => "(ip ip6)", - description => "Allow hkp access", - rule => "&SERVICE(tcp, 11371)" - } - @ferm::rule { "dsa-rsync": - domain => "(ip ip6)", - description => "Allow rsync access", - rule => "&SERVICE(tcp, 873)" - } - } - } - case $brokenhosts { - "true": { include hosts } - } - case $hoster { - "ubcece", "darmstadt", "ftcollins", "grnet": { include resolv } - } - case $portforwarder_user_exists { - "true": { include portforwarder } } + + if $::brokenhosts { + include hosts + } + + if $::portforwarder_user_exists { + include portforwarder + } + include samhain + + case $::hostname { + chopin,geo3,soler,wieck: { + include debian-radvd + } + } + + if $::kernel == 'Linux' { + include entropykey + } + + if ($::postgres84 or $::postgres90) { + include postgres + } } + +# vim:set et: +# vim:set sts=4 ts=4: +# vim:set shiftwidth=4: