From c44807b6b28b20269b90da0a77235f256b72a9df Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Tue, 23 Feb 2010 23:32:54 +0000 Subject: [PATCH] clean up samhain template by role instead of by hostname Signed-off-by: Stephen Gran --- modules/samhain/templates/samhainrc.erb | 74 ++++++++++++------------- 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/modules/samhain/templates/samhainrc.erb b/modules/samhain/templates/samhainrc.erb index 7ab6fa5b..2072ae69 100644 --- a/modules/samhain/templates/samhainrc.erb +++ b/modules/samhain/templates/samhainrc.erb @@ -78,8 +78,7 @@ IgnoreMissing=/etc/lvm/archive/vg.*.vg file=/etc/mtab file=/etc/ssh_random_seed file=/etc/asound.conf -<% case hoster when "ubcece", "darmstadt", "ftcollins" then "" -else -%> +<% case hoster when "ubcece", "darmstadt", "ftcollins", "grnet" then -%> file=/etc/resolv.conf <% end -%> file=/etc/localtime @@ -95,15 +94,16 @@ file=/etc/network/run/ifstate file=/var/state/samhain/samhain_file file=/etc/bind/zones/db.debian.net file=/etc/exim4/bsmtp -<% if hostname == "geo1" || hostname == "geo2" || hostname == "geo3" -%> +<% if classes.include?("named::geodns") -%> file=/etc/bind file=/etc/bind/named.conf.acl -file=/etc/bind/named.conf.options file=/etc/bind/named.conf.local file=/etc/bind/geodns/named.conf.geo file=/etc/bind/geodns/recvconf.files <% end -%> - +<% if classes.include?("named") -%> +file=/etc/bind/named.conf.options +<% end -%> # # There are files in /etc that might change, thus changing the directory @@ -133,13 +133,10 @@ file=/etc/nagios file=/etc/nagios/nrpe.d file=/etc/nagios/obsolete-packages-ignore.d file=/etc/bind/geodns -<%= extradir="" -if nodeinfo['nagiosmaster'] - extradir="file=/etc/nagios3/puppetconf.d -file=/etc/puppet" -end -extradir -%> +<% if nodeinfo['nagiosmaster'] -%> +file=/etc/nagios3/puppetconf.d +file=/etc/puppet +<% end -%> file=/etc/puppet file=/etc/cron.d file=/usr/lib/nagios/plugins @@ -214,10 +211,9 @@ file=/var/log/syslog ## ## This file might be created or removed by the system sometimes. ## -<% case hoster when "ubcece", "darmstadt", "ftcollins" then "" -%> +<% case hoster when "ubcece", "darmstadt", "ftcollins", "grnet" then -%> file=/etc/resolv.conf -<% else -end -%> +<% end -%> file=/etc/resolv.conf.pcmcia.save file=/etc/nologin file=/etc/postfix/debian.db @@ -363,23 +359,30 @@ file=/etc/monit/monit.d/01puppet file=/etc/monit/monit.d/00debian.org file=/etc/cron.d/dsa-puppet-stuff file=/etc/cron.d/dsa-buildd -<%= extrafiles="" -case fqdn -when "tchaikovsky.debian.org": extrafiles="file=/etc/nagios3/puppetconf.d/auto-hostgroups.cfg +<% if nodeinfo['nagiosmaster'] -%> +file=/etc/nagios3/puppetconf.d/auto-hostgroups.cfg file=/etc/nagios3/puppetconf.d/auto-hosts.cfg file=/etc/nagios3/puppetconf.d/auto-services.cfg file=/etc/nagios3/puppetconf.d/auto-dependencies.cfg file=/etc/nagios3/puppetconf.d/auto-hostextinfo.cfg file=/etc/nagios3/puppetconf.d/auto-serviceextinfo.cfg -file=/etc/munin/munin.conf" -when "handel.debian.org": extrafiles="dir=8/etc/puppet" -when "dijkstra.debian.org": extrafiles="dir=4/etc/dsa-kvm" -when /geo[123].debian.org/: extrafiles="dir=1/etc/bind/geodns" -when /(senfl|ravel|orff|klecker).debian.org/: extrafiles="dir=1/etc/bind -file=/etc/bind/named.conf.debian-zones" -end -extrafiles -%> +<% end -%> +<% if nodeinfo['muninmaster'] -%> +file=/etc/munin/munin.conf +<% end -%> +<% if nodeinfo['puppetmaster'] -%> +dir=8/etc/puppet +<% end -%> +<% if classes.include?('named::geodns') -%> +dir=1/etc/bind/geodns +<% end -%> +<% if classes.include?('named::secondary') -%> +dir=1/etc/bind +file=/etc/bind/named.conf.debian-zones +<% end -%> +<% if fqdn == "dijkstra.debian.org" -%> +dir=4/etc/dsa-kvm +<% end -%> <% if nodeinfo['buildd'] -%> dir=3/etc/lvm @@ -832,19 +835,12 @@ SetMailNum = 10 SetMailAddress=samhain-reports@debian.org ## Mail relay (IP address) -<%= -out="" -if not nodeinfo['smarthost'].empty? - out = ' -SetMailRelay = localhost -' -else -out = ' +<% if nodeinfo['smarthost'].empty? -%> SetMailRelay = master.debian.org -' -end -out -%> +<% else -%> +SetMailRelay = localhost +<% end -%> + ## Custom subject format # MailSubject = [Samhain at %H] %T: %S -- 2.39.2