Skip to content

/ Zope / gocept svn checkins / Archive / 2008 / 2008-11 / SVN: r7099 - in gocept.infrastructure/testing: . portage-gocept/app-backup/gocept-backup puppet/manifests/classes puppet/modules/app_admin/files puppet/modules/app_admin/manifests puppet/modules/app_admin/templates puppet/modules/mail_client puppet/modules/mail_client/files puppet/modules/mail_client/manifests puppet/modules/mail_client/templates puppet/modules/mail_mta puppet/modules/mail_mta/files puppet/modules/mail_mta/manifests puppet/modules/mail_mta/templates puppet/modules/net_analyzer/files puppet/modules/net_analyzer/files/apache puppet/modules/net_analyzer/files/nagios puppet/modules/net_analyzer/files/nagios/globals puppet/modules/net_analyzer/manifests puppet/modules/net_analyzer/templates puppet/modules/net_analyzer/templates/nagios puppet/modules/net_misc/manifests puppet/modules/sys_apps/files puppet/modules/sys_apps/manifests puppet/modules/sys_apps/templates puppet/modules/sys_fs puppet/modules/sys_portage/files puppet/modules/sys_portage/manifests puppe...

[ << ] [ >> ]

[ SVN: r7087 - gocept.collmex/trunk/src/gocept/collm... ] [ SVN: r7100 - in gocept.infrastructure/feature_syst... ]

SVN: r7099 - in gocept.infrastructure/testing: . portage-gocept/app-backup/gocept-backup puppet/manifests/classes puppet/modules/app_admin/files puppet/modules/app_admin/manifests puppet/modules/app_admin/templates puppet/modules/mail_client puppet/modules/mail_client/files puppet/modules/mail_client/manifests puppet/modules/mail_client/templates puppet/modules/mail_mta puppet/modules/mail_mta/files puppet/modules/mail_mta/manifests puppet/modules/mail_mta/templates puppet/modules/net_analyzer/files puppet/modules/net_analyzer/files/apache puppet/modules/net_analyzer/files/nagios puppet/modules/net_analyzer/files/nagios/globals puppet/modules/net_analyzer/manifests puppet/modules/net_analyzer/templates puppet/modules/net_analyzer/templates/nagios puppet/modules/net_misc/manifests puppet/modules/sys_apps/files puppet/modules/sys_apps/manifests puppet/modules/sys_apps/templates puppet/modules/sys_fs puppet/modules/sys_portage/files puppet/modules/sys_portage/manifests puppe...
Christian Kauhaus <kc(at)gocept.com>
2008-11-28 12:45:01 [ FULL ]
Author: ckauhaus
Date: Fri Nov 28 12:44:55 2008
New Revision: 7099

Log:
merged feature_monitoring_66066


Added:
  
gocept.infrastructure/testing/puppet/modules/app_admin/files/generate-groups.sh
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/app_admin/files/generate-groups.sh
  
gocept.infrastructure/testing/puppet/modules/app_admin/files/generate-people.sh
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/app_admin/files/generate-people.sh
  
gocept.infrastructure/testing/puppet/modules/app_admin/templates/puppetmaster.cron.erb
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/app_admin/templates/puppetmaster.cron.erb
   gocept.infrastructure/testing/puppet/modules/mail_client/
      - copied from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/mail_client/
   gocept.infrastructure/testing/puppet/modules/mail_client/files/
      - copied from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/mail_client/files/
   gocept.infrastructure/testing/puppet/modules/mail_client/manifests/
      - copied from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/mail_client/manifests/
   gocept.infrastructure/testing/puppet/modules/mail_client/manifests/mailx.pp
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/mail_client/manifests/mailx.pp
   gocept.infrastructure/testing/puppet/modules/mail_client/templates/
      - copied from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/mail_client/templates/
   gocept.infrastructure/testing/puppet/modules/mail_mta/
      - copied from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/mail_mta/
   gocept.infrastructure/testing/puppet/modules/mail_mta/files/
      - copied from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/mail_mta/files/
   gocept.infrastructure/testing/puppet/modules/mail_mta/manifests/
      - copied from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/mail_mta/manifests/
   gocept.infrastructure/testing/puppet/modules/mail_mta/manifests/init.pp
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/mail_mta/manifests/init.pp
   gocept.infrastructure/testing/puppet/modules/mail_mta/manifests/ssmtp.pp
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/mail_mta/manifests/ssmtp.pp
   gocept.infrastructure/testing/puppet/modules/mail_mta/templates/
      - copied from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/mail_mta/templates/
  
gocept.infrastructure/testing/puppet/modules/mail_mta/templates/revaliases.erb
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/mail_mta/templates/revaliases.erb
  
gocept.infrastructure/testing/puppet/modules/mail_mta/templates/ssmtp.conf.erb
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/mail_mta/templates/ssmtp.conf.erb
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/files/nagios/globals/checkcommands.cfg
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/net_analyzer/files/nagios/globals/checkcommands.cfg
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/files/nagios/globals/servicegroups.cfg
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/net_analyzer/files/nagios/globals/servicegroups.cfg
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/files/update-hostgroups.rb
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/net_analyzer/files/update-hostgroups.rb
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/templates/monitor_vhost.conf.erb
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/net_analyzer/templates/monitor_vhost.conf.erb
   gocept.infrastructure/testing/puppet/modules/net_analyzer/templates/nagios/
      - copied from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/net_analyzer/templates/nagios/
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/templates/nagios/cgi.cfg.erb
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/net_analyzer/templates/nagios/cgi.cfg.erb
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/templates/nagios/contacts.cfg.erb
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/net_analyzer/templates/nagios/contacts.cfg.erb
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/templates/nagios/host.cfg.erb
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/net_analyzer/templates/nagios/host.cfg.erb
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/templates/nagios/hostgroup.cfg.erb
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/net_analyzer/templates/nagios/hostgroup.cfg.erb
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/templates/nagios/service.cfg.erb
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/net_analyzer/templates/nagios/service.cfg.erb
  
gocept.infrastructure/testing/puppet/modules/sys_portage/files/cron.daily_emerge
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/sys_portage/files/cron.daily_emerge
   gocept.infrastructure/testing/puppet/modules/sys_process/templates/
      - copied from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/sys_process/templates/
  
gocept.infrastructure/testing/puppet/modules/sys_process/templates/crontab.erb
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/sys_process/templates/crontab.erb
  
gocept.infrastructure/testing/puppet/modules/www_apache/files/apache/modules.d/
      - copied from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/www_apache/files/apache/modules.d/
  
gocept.infrastructure/testing/puppet/modules/www_apache/files/apache/modules.d/00_mpm.conf
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/www_apache/files/apache/modules.d/00_mpm.conf
  
gocept.infrastructure/testing/puppet/modules/www_apache/files/apache/vhosts.d/addresses.conf
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/www_apache/files/apache/vhosts.d/addresses.conf
   gocept.infrastructure/testing/puppet/modules/www_apache/templates/
      - copied from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/www_apache/templates/
  
gocept.infrastructure/testing/puppet/modules/www_apache/templates/vhost.conf.erb
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/www_apache/templates/vhost.conf.erb
  
gocept.infrastructure/testing/puppet/modules/www_apache/templates/vhost.include.erb
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/modules/www_apache/templates/vhost.include.erb
  
gocept.infrastructure/testing/puppet/plugins/puppet/parser/functions/eui64.rb
      - copied unchanged from r7098,
gocept.infrastructure/feature_monitoring_66066/puppet/plugins/puppet/parser/functions/eui64.rb
Removed:
  
gocept.infrastructure/testing/puppet/modules/app_admin/files/puppetmaster.cron
   gocept.infrastructure/testing/puppet/modules/net_analyzer/files/apache/
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/files/nagios/cgi.cfg
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/templates/nagios_host.cfg.erb
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/templates/nagios_service.cfg.erb
  
gocept.infrastructure/testing/puppet/modules/www_apache/files/apache/vhosts.d/00_default_ssl_vhost.conf
  
gocept.infrastructure/testing/puppet/modules/www_apache/files/apache/vhosts.d/00_default_vhost.conf
  
gocept.infrastructure/testing/puppet/modules/www_apache/files/apache/vhosts.d/default_vhost.include
Modified:
   gocept.infrastructure/testing/   (props changed)
  
gocept.infrastructure/testing/portage-gocept/app-backup/gocept-backup/gocept-backup-0.8.ebuild
  (props changed)
   gocept.infrastructure/testing/puppet/manifests/classes/location.pp  
(contents, props changed)
   gocept.infrastructure/testing/puppet/manifests/classes/machine.pp
   gocept.infrastructure/testing/puppet/manifests/classes/role.pp
   gocept.infrastructure/testing/puppet/modules/app_admin/files/puppet.cron
   gocept.infrastructure/testing/puppet/modules/app_admin/files/update-puppet
   gocept.infrastructure/testing/puppet/modules/app_admin/manifests/puppet.pp
  
gocept.infrastructure/testing/puppet/modules/app_admin/templates/puppet.conf.erb
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/files/nagios/globals/templates.cfg
  (contents, props changed)
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/files/nagios/nagios.cfg
  (contents, props changed)
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/files/nagios/nrpe.cfg
  (props changed)
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/manifests/defines.pp
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/manifests/nagios.pp
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/templates/trafficclient.conf.erb
  (props changed)
  
gocept.infrastructure/testing/puppet/modules/net_analyzer/templates/xinetd_nrpe.erb
   gocept.infrastructure/testing/puppet/modules/net_misc/manifests/ntp.pp
   gocept.infrastructure/testing/puppet/modules/net_misc/manifests/ssh.pp
   gocept.infrastructure/testing/puppet/modules/sys_apps/files/   (props
changed)
  
gocept.infrastructure/testing/puppet/modules/sys_apps/manifests/baselayout.pp
  
gocept.infrastructure/testing/puppet/modules/sys_apps/manifests/network_interface.pp
  (contents, props changed)
   gocept.infrastructure/testing/puppet/modules/sys_apps/manifests/xinetd.pp
   gocept.infrastructure/testing/puppet/modules/sys_apps/templates/   (props
changed)
  
gocept.infrastructure/testing/puppet/modules/sys_apps/templates/resolv.conf.erb
   gocept.infrastructure/testing/puppet/modules/sys_fs/   (props changed)
  
gocept.infrastructure/testing/puppet/modules/sys_portage/manifests/defines.pp
  
gocept.infrastructure/testing/puppet/modules/sys_portage/manifests/portage.pp
  
gocept.infrastructure/testing/puppet/modules/sys_portage/templates/make.conf.erb
  (props changed)
  
gocept.infrastructure/testing/puppet/modules/sys_process/manifests/vixie_cron.pp
   gocept.infrastructure/testing/puppet/modules/www_apache/files/conf.d_apache2
   gocept.infrastructure/testing/puppet/modules/www_apache/manifests/apache.pp
   gocept.infrastructure/testing/puppet/modules/www_nginx/   (props changed)
   gocept.infrastructure/testing/puppet/modules/www_nginx/manifests/nginx.pp  
(contents, props changed)
   gocept.infrastructure/testing/puppet/util/node.sh

Modified: gocept.infrastructure/testing/puppet/manifests/classes/location.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/manifests/classes/location.pp	(original)
+++ gocept.infrastructure/testing/puppet/manifests/classes/location.pp	Fri Nov
28 12:44:55 2008
(at)(at) -7,14 +7,16 (at)(at)
     include "location::$location"
 }
 
-# HLkomm Rechenzentrum Leipzig
 class location::rzl {
+    net_analyzer::hostgroup { "location:rzl":
+        comment => "HLkomm ZNK Leipzig"
+    }
     $suffix = "gocept.net"
     $networks = "213.187.85.128/26 217.69.239.128/25 2001:470:9aaf:10::/56"
     $ip4_gw_fe = "213.187.85.190"
-    $ip6_fe = "2001:470:9aaf:11::/64"
-    $ip6_srv = "2001:470:9aaf:12::/64"
-    $ip6_sto = "2001:470:9aaf:13::/64"
+    $ip6net_fe = "2001:470:9aaf:12::/64"
+    $ip6net_srv = "2001:470:9aaf:13::/64"
+    $ip6net_sto = "2001:470:9aaf:14::/64"
     $puppetmaster = "stampy.rzl.gocept.net"
     $ldap_server = "ldap.gocept.com"
     $nameservers = "213.187.85.129 195.62.106.5"
(at)(at) -24,14 +26,16 (at)(at)
 }
 
 
-# Halle office
 class location::whq {
+    net_analyzer::hostgroup { "location:whq":
+        comment => "gocept office Halle"
+    }
     $suffix = "gocept.com"
     $networks = "195.62.106.0/25 2001:470:9aaf::/56"
-    $ip6_fe = "2001:470:9aaf:1::/64"
-    $ip6_srv = "2001:470:9aaf:2::/64"
-    $ip6_sto = "2001:470:9aaf:3::/64"
-    $puppetmaster = "uter.whq.gocept.com"
+    $ip6net_fe = "2001:470:9aaf:2::/64"
+    $ip6net_srv = "2001:470:9aaf:3::/64"
+    $ip6net_sto = "2001:470:9aaf:4::/64"
+    $puppetmaster = "stampy.whq.gocept.com"
     $ldap_server = "ldap.whq.gocept.com"
     $nameservers = "195.62.106.5 213.187.85.129"
     $ntp_servers = "uter.whq.gocept.com marge.whq.gocept.com
grampa.whq.gocept.com" # XXX: substitute through ntp_server class
(at)(at) -43,4 +47,5 (at)(at)
 # collector scope
 class location {
     $nagios_server = $puppetmaster
+    $smtp_server = "mail.gocept.net"
 }

Modified: gocept.infrastructure/testing/puppet/manifests/classes/machine.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/manifests/classes/machine.pp	(original)
+++ gocept.infrastructure/testing/puppet/manifests/classes/machine.pp	Fri Nov
28 12:44:55 2008
(at)(at) -9,16 +9,20 (at)(at)
 }
 
 
-# Base class for nodes running directly on the iron
 class machine::physical {
+    net_analyzer::hostgroup { "machine::physical":
+        comment => "Running directly on the hardware"
+    }
     $network_bridged = true
     $canonical_alias = "$hostname.$location.${location::suffix}"
     include machine
 }
 
 
-# Base class for nodes running under some sort of virtual machine monitor
 class machine::virtual {
+    net_analyzer::hostgroup { "machine::virtual":
+        comment => "Running under a virtual machine monitor"
+    }
     $network_bridged = false
     $canonical_alias = "$hostname.${location::suffix}"
     include machine

Modified: gocept.infrastructure/testing/puppet/manifests/classes/role.pp
==============================================================================
--- gocept.infrastructure/testing/puppet/manifests/classes/role.pp	(original)
+++ gocept.infrastructure/testing/puppet/manifests/classes/role.pp	Fri Nov 28
12:44:55 2008
(at)(at) -2,22 +2,23 (at)(at)
 # See also LICENSE.txt
 
 # Policy classes for node roles. A node may fulfill one or several roles which
-# are represented as descendants from role::basic.
+# are represented as descendants from role::default.
 
 
 # abstract base class for all roles
-class role::basic {
+class role::default {
     include location::global
     include machine::global
 }
 
 
 # generic functionality to be found on every node
-class role::generic inherits role::basic {
+class role::generic inherits role::default {
     include app_admin::puppetclient
     include app_admin::sudo
     include app_admin::tmpwatch
     include app_shells::bash
+    include mail_mta::ssmtp
     include net_analyzer::nagios_client
     include net_analyzer::traffic_client
     include net_firewall::iptables
(at)(at) -28,24 +29,30 (at)(at)
     include sys_portage::portage
     include sys_process::vixie_cron
 
+    net_analyzer::hostgroup { "role::generic": comment => "All nodes" }
     User <| tag == "admin" |>
-    net_analyzer::host { $fqdn: }
 }
 
 
-# node that acts as a Puppet master
 class role::puppetmaster inherits role::generic {
+    net_analyzer::hostgroup { "role::puppetmaster":
+        comment => "Puppet masters"
+    }
     include app_admin::puppetmaster
 }
 
 
-# node that acts as a Nagios server
 class role::nagios inherits role::generic {
+    net_analyzer::hostgroup { "role::nagios_server":
+        comment => "Nagios servers"
+    }
     include net_analyzer::nagios_server
 }
 
-# Nodes for customer projects
 class role::customerproject inherits role::generic {
+    net_analyzer::hostgroup { "role::customerproject":
+        comment => "Nodes used for customer projects"
+    }
     user {"service":
         comment => "Project service user",
         home => "/home/service",
(at)(at) -67,18 +74,25 (at)(at)
     }
 
     sys_portage::package { "subversion": }
-
 }
 
-# node that acts as a frontend server
 class role::webgateway inherits role::customerproject {
+    net_analyzer::hostgroup { "role::webgateway":
+        comment => "Front end web servers"
+    }
     include www_nginx::nginx
 }
 
 class role::dbserver inherits role::customerproject {
+    net_analyzer::hostgroup { "role::dbserver":
+        comment => "Database servers"
+    }
     include net_misc::memcached
 }
 
 class role::appserver inherits role::customerproject {
+    net_analyzer::hostgroup { "role::appserver":
+        comment => "Application (usually Zope) servers"
+    }
     include www_zope::appserver
 }

Modified:
gocept.infrastructure/testing/puppet/modules/app_admin/files/puppet.cron
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/app_admin/files/puppet.cron	(original)
+++
gocept.infrastructure/testing/puppet/modules/app_admin/files/puppet.cron	Fri
Nov 28 12:44:55 2008
(at)(at) -1,4 +1,4 (at)(at)
 #!/bin/bash
 # Daily maintenance tasks for all puppet clients
 set -e
-tmpwatch --dirmtime --all 14d /var/lib/puppet/{bucket,clientbucket}/
+tmpwatch --dirmtime --all 14d /var/lib/puppet/{bucket,clientbucket}/.

Modified:
gocept.infrastructure/testing/puppet/modules/app_admin/files/update-puppet
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/app_admin/files/update-puppet	(original)
+++
gocept.infrastructure/testing/puppet/modules/app_admin/files/update-puppet	Fri
Nov 28 12:44:55 2008
(at)(at) -1,11 +1,17 (at)(at)
 #!/bin/bash
-# Update all puppet direcories on the Puppetmaster from SVN.
+# Copyright (c) 2008 gocept gmbh & co. kg
+# See also LICENSE.txt
+# Update all puppet direcories on the Puppetmaster from SVN/directory.
 set -e
 
+LDAP_SERVER="$1"
+LDAP_PASSWORD="$2"
 HOME="/home/puppet"
 USER="puppet"
 
-for d in ${HOME}/{production,hotfix,testing,feature}; do
+PATH="/usr/local/bin:/usr/bin:/bin:/opt/bin"
+
+for d in ${HOME}/{production,hotfix,testing,feature*}; do
     cmd="svn up --quiet $d"
     if [[ `id -u` == 0 ]]; then
         su -c "$cmd" $USER
(at)(at) -13,3 +19,9 (at)(at)
         $cmd
     fi
 done
+
+generate-people.sh ${LDAP_SERVER} ${LDAP_PASSWORD} \
+  > ${HOME}/directory/people/people.yml
+generate-groups.sh ${LDAP_SERVER} ${LDAP_PASSWORD} \
+  > ${HOME}/directory/people/groups.yml
+chown ${USER} ${HOME}/directory/people/*.yml

Modified:
gocept.infrastructure/testing/puppet/modules/app_admin/manifests/puppet.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/app_admin/manifests/puppet.pp	(original)
+++
gocept.infrastructure/testing/puppet/modules/app_admin/manifests/puppet.pp	Fri
Nov 28 12:44:55 2008
(at)(at) -5,6 +5,7 (at)(at)
     include tmpwatch
 
     $puppet_root = "/home/puppet"
+    $directory = "${puppet_root}/directory"
     $envlist = environments("name", $puppet_root)
     $envpaths = environments("path", $puppet_root)
     $cron_minute = fqdn_rand(30)
(at)(at) -36,7 +37,8 (at)(at)
             mode => 0755
     }
 
-    net_analyzer::nrpe_service { "puppet_localconfig":
+    net_analyzer::service { "puppet_localconfig":
+        type => "nrpe",
         command => "check_file_age -w 3600 -c 7200 -f
/var/lib/puppet/localconfig.yaml"
     }
 
(at)(at) -52,6 +54,8 (at)(at)
         subscribe +> File["/etc/init.d/puppetmaster"]
     }
 
+    $ldap_server = $location::ldap_server
+
     file {
         "/etc/init.d/puppetmaster":
             source => "puppet:///app_admin/init.d_puppetmaster",
(at)(at) -61,8 +65,14 (at)(at)
         "/usr/local/bin/update-puppet":
             source => "puppet:///app_admin/update-puppet",
             mode => 0755;
+        "/usr/local/bin/generate-people.sh":
+            source => "puppet:///app_admin/generate-people.sh",
+            mode => 0755;
+        "/usr/local/bin/generate-groups.sh":
+            source => "puppet:///app_admin/generate-groups.sh",
+            mode => 0755;
         "/etc/cron.hourly/puppetmaster":
-            source => "puppet:///app_admin/puppetmaster.cron",
-            mode => 0755
+            content => template("app_admin/puppetmaster.cron.erb"),
+            mode => 0711
     }
 }

Modified:
gocept.infrastructure/testing/puppet/modules/app_admin/templates/puppet.conf.erb
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/app_admin/templates/puppet.conf.erb	(original)
+++
gocept.infrastructure/testing/puppet/modules/app_admin/templates/puppet.conf.erb	Fri
Nov 28 12:44:55 2008
(at)(at) -34,6 +34,11 (at)(at)
     # Whether plugins should be synced with the central server.
     pluginsync = true
 
+    # Where Puppet should look for facts.  Multiple directories should
+    # be colon-separated, like normal PATH variables.
+    # The default value is '$vardir/facts'.
+    factpath = $vardir/lib/facter
+
 <% for path in envpaths.split %>
 [<%= File.basename(path) %>]
     manifestdir = <%= path %>/puppet/manifests

Modified:
gocept.infrastructure/testing/puppet/modules/net_analyzer/files/nagios/globals/templates.cfg
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/net_analyzer/files/nagios/globals/templates.cfg	(original)
+++
gocept.infrastructure/testing/puppet/modules/net_analyzer/files/nagios/globals/templates.cfg	Fri
Nov 28 12:44:55 2008
(at)(at) -1,3 +1,8 (at)(at)
+# Managed by Puppet: do not edit this file directly. It will be overwritten!
+# Nagios templates
+# Copyright (c) 2008 gocept gmbh & co. kg
+# See also LICENSE.txt
+
 define host {
     name                          generic-host
     register                      0
(at)(at) -15,8 +20,7 (at)(at)
     max_check_attempts            10
     check_command                 check-host-alive
     notification_interval         120
-    notification_options          d,u,r
-    contacts                      admin
+    notification_options          d,u,r,f,s
 }
 
 define service {
(at)(at) -39,48 +43,22 (at)(at)
     max_check_attempts              3
     normal_check_interval           10
     retry_check_interval            2
-    contacts                        admin
-    notification_options            w,u,c,r
+    notification_options            w,u,c,r,f,s
     notification_interval           60
     notification_period             24x7
 }
 
-define command {
-    command_name    check
-    command_line    $USER1$/check_$ARG1$ -H $HOSTADDRESS$ $ARG2$
-}
-
-define command {
-    command_name    check_nrpe
-    command_line    /usr/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
-t 120
-}
-
-define command {
-    command_name    check-host-alive
-    command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c
5000.0,100% -p 5
-}
-
-define command{
-    command_name    notify-host-by-email
-    command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification
Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress:
$HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail
-s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **"
$CONTACTEMAIL$
-}
-
-define command {
-    command_name    notify-service-by-email
-    command_line    /usr/bin/printf "%b" "***** Nagios *****\n\nNotification
Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress:
$HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert:
$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
-}
-
 define contact {
-    contact_name                   admin
-    email                          admin(at)gocept.com
-    host_notifications_enabled     1
-    service_notifications_enabled  1
-    host_notification_period       24x7
-    service_notification_period    24x7
-    host_notification_options      d,u,r,f,s
-    service_notification_options   w,u,c,r,f,s
-    host_notification_commands     notify-host-by-email
-    service_notification_commands  notify-service-by-email
+    name                            generic-contact
+    register                        0
+    host_notifications_enabled      1
+    service_notifications_enabled   1
+    host_notification_period        24x7
+    service_notification_period     24x7
+    host_notification_options       d,u,r,f,s
+    service_notification_options    w,u,c,r,f,s
+    host_notification_commands      notify-host-by-email
+    service_notification_commands   notify-service-by-email
 }
 
 define timeperiod {

Modified:
gocept.infrastructure/testing/puppet/modules/net_analyzer/files/nagios/nagios.cfg
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/net_analyzer/files/nagios/nagios.cfg	(original)
+++
gocept.infrastructure/testing/puppet/modules/net_analyzer/files/nagios/nagios.cfg	Fri
Nov 28 12:44:55 2008
(at)(at) -27,6 +27,7 (at)(at)
 # if you wish (as shown below), or keep them all in a single config file.
 
 cfg_dir=/etc/nagios/globals
+cfg_dir=/etc/nagios/hostgroups
 cfg_dir=/etc/nagios/hosts
 
 

Modified:
gocept.infrastructure/testing/puppet/modules/net_analyzer/manifests/defines.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/net_analyzer/manifests/defines.pp	(original)
+++
gocept.infrastructure/testing/puppet/modules/net_analyzer/manifests/defines.pp	Fri
Nov 28 12:44:55 2008
(at)(at) -1,3 +1,5 (at)(at)
+# Copyright (c) 2008 gocept gmbh & co. kg
+# See also LICENSE.txt
 # Macros for easy definition of Nagios checks
 
 define net_analyzer::host($hostalias = false) {
(at)(at) -14,49 +16,52 (at)(at)
             ensure => directory;
         "$directory/_host.cfg":
             tag => "nagios_server",
-            mode => "0644",
-            content => template("net_analyzer/nagios_host.cfg.erb"),
-            notify => Service["nagios"]
+            content => template("net_analyzer/nagios/host.cfg.erb"),
+            notify => Service["nagios"];
     }
 }
 
-define net_analyzer::direct_service($command = false,
-                                    $ensure = "present") {
+define net_analyzer::service($command = false, $ensure = "present",
+                             $type = "direct") {
     $directory = "/etc/nagios/hosts/$hostname"
-    $file = filename_safe("$title.cfg")
     $service = $title
-    $check_command = $command ? {
-        false => "check!$title",
-        default => "check!$command"
+    $safetitle = filename_safe($title)
+    $file = "$safetitle.cfg"
+
+    case $type {
+        "direct": {
+            $servicegroups = "direct"
+            $check_command = $command ? {
+                false => "check!$title",
+                default => "check!$command"
+            }
+        }
+        "nrpe": {
+            $servicegroups = "nrpe"
+            $check_command = "check_nrpe!$safetitle"
+            file { "/etc/nagios/nrpe/$file":
+                content =>
"command[$safetitle]=/usr/lib/nagios/plugins/$command\n"
+            }
+        }
     }
 
     (at)(at)file { "$directory/$file":
         tag => "nagios_server",
         ensure => $ensure,
         require => File[$directory],
-        content => template("net_analyzer/nagios_service.cfg.erb"),
+        content => template("net_analyzer/nagios/service.cfg.erb"),
         notify => Service["nagios"]
     }
-
 }
 
-define net_analyzer::nrpe_service($command = "", $ensure = "present") {
-    $directory = "/etc/nagios/hosts/$hostname"
-    $safetitle = filename_safe($title)
-    $file = "$safetitle.cfg"
-    $service = $title
-    $check_command = "check_nrpe!$safetitle"
-
-    (at)(at)file { "$directory/$file":
-        tag => "nagios_server",
-        ensure => $ensure,
-        require => File[$directory],
-        content => template("net_analyzer/nagios_service.cfg.erb"),
-        notify => Service["nagios"]
-    }
+define net_analyzer::hostgroup($comment) {
+    $hostgroups = "/etc/nagios/hostgroups"
+    $hostgroup_name = $title
 
-    file { "/etc/nagios/nrpe/$file":
-        content => "command[$safetitle]=/usr/lib/nagios/plugins/$command\n"
+    (at)(at)file {
+        "$hostgroups/$hostgroup_name.member.$hostname.in":
+            tag => "nagios_server",
+            content => template("net_analyzer/nagios/hostgroup.cfg.erb"),
+            notify => Exec["update-hostgroups"]
     }
 }
-

Modified:
gocept.infrastructure/testing/puppet/modules/net_analyzer/manifests/nagios.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/net_analyzer/manifests/nagios.pp	(original)
+++
gocept.infrastructure/testing/puppet/modules/net_analyzer/manifests/nagios.pp	Fri
Nov 28 12:44:55 2008
(at)(at) -1,6 +1,12 (at)(at)
+# Copyright (c) 2008 gocept gmbh & co. kg
+# See also LICENSE.txt
+
 class net_analyzer::nagios_client {
     include location
     include sys_apps::xinetd
+    include mail_mta::ssmtp
+
+    $suffix = $location::suffix
 
     group { "nagios":
         gid => 440
(at)(at) -9,8 +15,8 (at)(at)
     user { "nagios":
         gid => "nagios",
         comment => "Nagios/$hostname",
-        groups => [],
-        require => Group["nagios"]
+        groups => ["ssmtp"],
+        require => [Group["nagios"], Group["ssmtp"]]
     }
 
     sys_portage::package {
(at)(at) -21,6 +27,8 (at)(at)
             ensure => "1.4.12-r101"
     }
 
+    net_analyzer::host { $fqdn: }
+
     file {
         "/etc/xinetd.d/nrpe":
             content => template("net_analyzer/xinetd_nrpe.erb"),
(at)(at) -44,7 +52,7 (at)(at)
 class net_analyzer::nagios_server inherits net_analyzer::nagios_client {
     include www_apache::apache
 
-    sys_portage::package { "nagios": 
+    sys_portage::package { "nagios":
         notify => Service["nagios"]
     }
 
(at)(at) -52,6 +60,10 (at)(at)
         notify => Service["nagios"]
     }
 
+    $directory = "/home/puppet/directory"
+    $contact_groups = ["crew", "admins"]
+    $ldap_server = $location::ldap_server
+
     file {
         "/var/nagios/rw":
             ensure => directory,
(at)(at) -63,21 +75,44 (at)(at)
             recurse => true,
             owner => "nagios",
             group => "apache";
-        "/etc/apache2/modules.d/99_nagios3.conf":
-            source =>
"puppet:///net_analyzer/apache/modules.d/99_nagios3.conf",
-            notify => Service["apache2"]
+        ["/etc/nagios/hosts", "/etc/nagios/hostgroups"]:
+            ensure => directory;
+        "/etc/nagios/cgi.cfg":
+            content => template("net_analyzer/nagios/cgi.cfg.erb"),
+            owner => "nagios",
+            group => "apache";
+        "/etc/nagios/globals/contacts.cfg":
+            content => template("net_analyzer/nagios/contacts.cfg.erb");
+        "/usr/local/sbin/update-hostgroups":
+            source => "puppet:///net_analyzer/update-hostgroups.rb",
+            mode => 0775;
     }
 
     File <<| tag == "nagios_server" |>>
 
+    exec { "update-hostgroups":
+        command => "/usr/local/sbin/update-hostgroups
/etc/nagios/hostgroups",
+        notify => Service["nagios"]
+    }
+
     Service["nagios"] {
         ensure => true,
         enable => true,
         hasstatus => true
     }
 
-    direct_service { "HTTP /nagios/":
-        command => "http!-u /nagios/ -e 302"
+    $basedir = "/usr/share/nagios/htdocs"
+    $vhost = "monitor.$location.${suffix}"
+
+    www_apache::vhost { $vhost:
+        ssl => true,
+        basedir => $basedir,
+        config => template("net_analyzer/monitor_vhost.conf.erb")
+    }
+
+    net_analyzer::service {
+        "http://$vhost/nagios/":
+            command => "http!-H $vhost -u /nagios/ -e 302"
     }
 
 }

Modified:
gocept.infrastructure/testing/puppet/modules/net_analyzer/templates/xinetd_nrpe.erb
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/net_analyzer/templates/xinetd_nrpe.erb	(original)
+++
gocept.infrastructure/testing/puppet/modules/net_analyzer/templates/xinetd_nrpe.erb	Fri
Nov 28 12:44:55 2008
(at)(at) -10,5 +10,5 (at)(at)
     server_args     = -c /etc/nagios/nrpe.cfg --inetd
     log_on_failure  += USERID
     disable         = no
-    only_from       = localhost <%=
scope.lookupvar('location::nagios_server') %>
+    only_from       = localhost <%= ".#{location}.#{suffix}" %>
 }

Modified:
gocept.infrastructure/testing/puppet/modules/net_misc/manifests/ntp.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/net_misc/manifests/ntp.pp	(original)
+++ gocept.infrastructure/testing/puppet/modules/net_misc/manifests/ntp.pp	Fri
Nov 28 12:44:55 2008
(at)(at) -22,7 +22,7 (at)(at)
 
     file { "/etc/ntp.conf": content => template("net_misc/ntp.conf.erb") }
 
-    net_analyzer::direct_service {
+    net_analyzer::service {
         "ntp time": command => "ntp_time";
         "ntp peers": command => "ntp_peer"
     }

Modified:
gocept.infrastructure/testing/puppet/modules/net_misc/manifests/ssh.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/net_misc/manifests/ssh.pp	(original)
+++ gocept.infrastructure/testing/puppet/modules/net_misc/manifests/ssh.pp	Fri
Nov 28 12:44:55 2008
(at)(at) -12,6 +12,6 (at)(at)
             subscribe => Package["openssh"]
     }
 
-    net_analyzer::direct_service { "ssh": }
+    net_analyzer::service { "ssh": }
 
 }

Modified:
gocept.infrastructure/testing/puppet/modules/sys_apps/manifests/baselayout.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/sys_apps/manifests/baselayout.pp	(original)
+++
gocept.infrastructure/testing/puppet/modules/sys_apps/manifests/baselayout.pp	Fri
Nov 28 12:44:55 2008
(at)(at) -6,6 +6,8 (at)(at)
 
     sys_portage::package { "iproute2": }
 
+    $suffix = $location::suffix
+
     file {
         "/etc/conf.d/net.d": ensure => directory;
         "/etc/conf.d/net": source => "puppet:///sys_apps/conf.d_net";
(at)(at) -18,7 +20,7 (at)(at)
             ip4 => $ip4_srv,
             ip6net => $ip6_srv,
             bridged => $machine::network_bridged,
-            extra_alias => "${machine::canonical_alias}";
+            canonical_alias => $machine::canonical_alias;
         "sto":
             mac => $mac_sto,
             ip4 => $ip4_sto,
(at)(at) -29,7 +31,8 (at)(at)
             mac => $mac_fe,
             ip4 => $ip4_fe,
             ip6net => $ip6_fe,
-            bridged => $machine::network_bridged
+            bridged => $machine::network_bridged,
+            extra_alias => $fqdn_fe
     }
 
     Host <<| |>>

Modified:
gocept.infrastructure/testing/puppet/modules/sys_apps/manifests/network_interface.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/sys_apps/manifests/network_interface.pp	(original)
+++
gocept.infrastructure/testing/puppet/modules/sys_apps/manifests/network_interface.pp	Fri
Nov 28 12:44:55 2008
(at)(at) -4,7 +4,8 (at)(at)
 # Generate all necessary configurations for a single network interface.
 # If there is a MAC address but no IP address given, configure 'null'
interfaces.
 define sys_apps::network_interface($mac = false, $ip4 = false, $ip6net =
false,
-                                   $extra_alias = false, $mtu = false, 
+                                   $extra_alias = false,
+                                   $canonical_alias = false, $mtu = false,
                                    $bridged = false) {
 
     $iface = $name
(at)(at) -14,6 +15,17 (at)(at)
     if $mac {
         sys_fs::interface_name { $iface: mac => $mac }
 
+        if $ip4 {
+            sys_apps::check_ip4 { $iface:
+                ip4 => $ip4,
+                extra => $extra_alias
+            }
+            sys_apps::etc_hosts { $fullname:
+                ip4 => $ip4,
+                canonical_alias => $canonical_alias
+            }
+        }
+
         file {
             "/etc/conf.d/net.d/$iface.sh":
                 content => template("sys_apps/conf.d_net.erb"),
(at)(at) -24,27 +36,13 (at)(at)
                 notify => Exec["rc-update net $iface"];
         }
 
+        # register init scripts with rc
         if $bridged {
             file {
                 "/etc/init.d/net.br$iface":
                     ensure => "net.lo",
                     notify => Exec["rc-update net $iface"];
             }
-        }
-
-        if $ip4 {
-            sys_apps::check_ip4 { $iface:
-                ip4 => $ip4,
-            }
-
-            sys_apps::etc_hosts { $fullname:
-                ip4 => $ip4,
-                extra => $extra_alias
-            }
-        }
-
-        # register init scripts with rc
-        if $bridged {
             exec { "rc-update net $iface":
                 command => "\
                          rc-update add net.br$iface default; \
(at)(at) -72,37 +70,70 (at)(at)
 }
 
 
-define sys_apps::check_ip4($ip4) {
+define sys_apps::check_ip4($ip4, $extra = false) {
     $iface = $name
     $ip4_addr = strip_netmask($ip4)
 
     # Define ping checks. We assume that the Nagios server has connectivity
     # to all interfaces
-    net_analyzer::direct_service { "ping $iface":
+    net_analyzer::service { "ping $iface":
         command => "icmp!-w 100,20% -c 200,40% -H $ip4_addr"
     }
 
     # Check nameserver
     if public_address($ip4_addr) {
         $reverse = dns_reverse($ip4_addr)
-        net_analyzer::direct_service {
-            "dns $fullname/A":
+        net_analyzer::service {
+            "DNS $fullname/A":
                 command => "dig!-H ns1 -T A -l $fullname -a $ip4_addr";
-            "dns $ip4_addr/PTR":
+            "DNS $ip4_addr/PTR":
                 command => "dig!-H ns1 -T PTR -l $reverse -a $fullname";
         }
+        if $extra {
+            net_analyzer::service {
+                "DNS $extra/A":
+                    command => "dig!-H ns1 -T A -l $extra -a $ip4_addr"
+            }
+        }
     }
 }
 
 
-define sys_apps::etc_hosts($ip4 = false, $ip6 = false, $extra = false) {
+define sys_apps::check_ip6($ip6net, $mac, $extra = false) {
+    $iface = $name
+    $ip6_addr = eui64($ip6net, $mac)
 
+    # Define ping checks. We assume that the Nagios server has connectivity
+    # to all interfaces
+    net_analyzer::service { "ping $iface":
+        command => "icmp!-w 100,20% -c 200,40% -H $ip6_addr"
+    }
+
+    # Check nameserver
+    $reverse = dns_reverse($ip6_addr)
+    net_analyzer::service {
+        "DNS $fullname/AAAA":
+            command => "dig!-H ns1 -T AAAA -l $fullname -a $ip6_addr";
+        "DNS $ip6_addr/PTR":
+            command => "dig!-H ns1 -T PTR -l $reverse -a $fullname";
+    }
+    if $extra {
+        net_analyzer::service {
+            "DNS $extra/AAAA":
+                command => "dig!-H ns1 -T AAAA -l $extra -a $ip6_addr"
+        }
+    }
+}
+
+
+define sys_apps::etc_hosts($ip4 = false, $ip6 = false,
+                           $canonical_alias = false) {
     $ip4_addr = strip_netmask($ip4)
 
     (at)(at)host { $name: ip => $ip4_addr }
 
-    if $extra {
-        (at)(at)host { $extra:
+    if $canonical_alias {
+        (at)(at)host { $canonical_alias:
             ip => $ip4_addr,
             alias => $hostname
         }

Modified:
gocept.infrastructure/testing/puppet/modules/sys_apps/manifests/xinetd.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/sys_apps/manifests/xinetd.pp	(original)
+++
gocept.infrastructure/testing/puppet/modules/sys_apps/manifests/xinetd.pp	Fri
Nov 28 12:44:55 2008
(at)(at) -8,7 +8,8 (at)(at)
         subscribe => Package["xinetd"]
     }
 
-    net_analyzer::nrpe_service { "proc xinetd":
+    net_analyzer::service { "proc xinetd":
+        type => "nrpe",
         command => "check_procs -C xinetd -u root -c 1:1 -w 1:1"
     }
 

Modified:
gocept.infrastructure/testing/puppet/modules/sys_apps/templates/resolv.conf.erb
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/sys_apps/templates/resolv.conf.erb	(original)
+++
gocept.infrastructure/testing/puppet/modules/sys_apps/templates/resolv.conf.erb	Fri
Nov 28 12:44:55 2008
(at)(at) -1,7 +1,9 (at)(at)
 # Managed by Puppet: do not edit this file directly. It will be overwritten!
 search <%=
-    "#{location}.#{scope.lookupvar('location::suffix')} " + \
-    scope.lookupvar('location::suffix')
+    "srv.#{location}.#{suffix} " + \
+    "fe.#{location}.#{suffix} " + \
+    "#{location}.#{suffix} " + \
+    suffix
 %>
 options ndots:3
 <%

Modified:
gocept.infrastructure/testing/puppet/modules/sys_portage/manifests/defines.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/sys_portage/manifests/defines.pp	(original)
+++
gocept.infrastructure/testing/puppet/modules/sys_portage/manifests/defines.pp	Fri
Nov 28 12:44:55 2008
(at)(at) -9,7 +9,7 (at)(at)
         require => [
             File["/etc/make.conf"],
             File["/etc/portage"],
-#            File["/etc/make.profile"],
+            File["/etc/make.profile"],
             Package["portage"],
             Package["portage-utils"],
             Package["eix"],

Modified:
gocept.infrastructure/testing/puppet/modules/sys_portage/manifests/portage.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/sys_portage/manifests/portage.pp	(original)
+++
gocept.infrastructure/testing/puppet/modules/sys_portage/manifests/portage.pp	Fri
Nov 28 12:44:55 2008
(at)(at) -3,6 +3,7 (at)(at)
 
 # Configuration for portage, emerge and friends
 class sys_portage::portage {
+    include sys_process::vixie_cron
 
     case $architecture {
         "amd64", "x86_64": {
(at)(at) -38,6 +39,11 (at)(at)
             source => "puppet:///sys_portage/portage",
             recurse => true;
         "/etc/make.profile":
-            ensure => $portage_profile
+            ensure => $portage_profile;
+        "/etc/cron.daily/emerge":
+            source => "puppet:///sys_portage/cron.daily_emerge",
+            mode => 0755;
+        # XXX: old version of above script
+        "/etc/cron.daily/portage": ensure => absent
     }
 }

Modified:
gocept.infrastructure/testing/puppet/modules/sys_process/manifests/vixie_cron.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/sys_process/manifests/vixie_cron.pp	(original)
+++
gocept.infrastructure/testing/puppet/modules/sys_process/manifests/vixie_cron.pp	Fri
Nov 28 12:44:55 2008
(at)(at) -7,14 +7,19 (at)(at)
         enable => true
     }
 
-    # Fix directory permissions. Cron refuses to run otherwise.
-    file { 
+    $minute = fqdn_rand(60)
+
+    file {
+        # Fix directory permissions. Cron refuses to run otherwise.
         ["/etc/cron.d", "/etc/cron.hourly", "/etc/cron.daily", 
          "/etc/cron.weekly", "/etc/cron.monthly"]:
-            mode => 0750
+            mode => 0750;
+        # Randomize cron.daily minute to prevent congestion
+        "/etc/crontab": content => template("sys_process/crontab.erb")
     }
 
-    net_analyzer::nrpe_service { "proc cron":
+    net_analyzer::service { "proc cron":
+        type => "nrpe",
         command => "check_procs -C cron -w 1:4 -c 1:10 -u root"
     }
 

Modified:
gocept.infrastructure/testing/puppet/modules/www_apache/files/conf.d_apache2
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/www_apache/files/conf.d_apache2	(original)
+++
gocept.infrastructure/testing/puppet/modules/www_apache/files/conf.d_apache2	Fri
Nov 28 12:44:55 2008
(at)(at) -1 +1,5 (at)(at)
-APACHE2_OPTS="-D DEFAULT_VHOST -D SSL -D SSL_DEFAULT_VHOST -D NAGIOS -D LDAP
-D AUTHNZ_LDAP"
+# Copyright (c) 2008 gocept gmbh & co. kg
+# See also LICENSE.txt
+# Managed by Puppet: do not edit this file directly. It will be overwritten!
+
+APACHE2_OPTS="-D SSL -D LDAP -D AUTHNZ_LDAP"

Modified:
gocept.infrastructure/testing/puppet/modules/www_apache/manifests/apache.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/www_apache/manifests/apache.pp	(original)
+++
gocept.infrastructure/testing/puppet/modules/www_apache/manifests/apache.pp	Fri
Nov 28 12:44:55 2008
(at)(at) -1,4 +1,9 (at)(at)
+# Copyright (c) 2008 gocept gmbh & co. kg
+# See also LICENSE.txt
+
+# Instantiate HTTP server
 class www_apache::apache {
+
     sys_portage::package { "apache": }
 
     file {
(at)(at) -7,9 +12,6 (at)(at)
         "/etc/apache2":
             source => "puppet:///www_apache/apache",
             recurse => true;
-        ["/etc/apache2/ssl/server.crt", "/etc/apache2/ssl/server.key"]:
-            # SSL keys must be managed manually
-            mode => "0600"
     }
 
     service { "apache2":
(at)(at) -20,12 +22,40 (at)(at)
             File["/etc/conf.d/apache2"]]
     }
 
-    net_analyzer::nrpe_service { "proc apache":
-        command => "check_procs -w 5:10 -c 1:20 -C apache2 -u apache"
+    net_analyzer::service { "proc apache":
+        type => "nrpe",
+        command => "check_procs -w 3:12 -c 1:24 -C apache2 -u apache"
+    }
+
+}
+
+
+# Generate virtual host definition and supporting configuration
+define www_apache::vhost($config, $basedir = false, $aliases = [], $ssl =
false) {
+    $vhost = $title
+    $docroot = $basedir ? {
+        false => "/srv/$vhost/www/htdocs",
+        default => $basedir
+    }
+
+    include www_apache::apache
+
+    file {
+        "/etc/apache2/vhosts.d/$vhost.conf":
+            content => template("www_apache/vhost.conf.erb"),
+            notify => Service["apache2"];
+        "/etc/apache2/vhosts.d/$vhost.include":
+            content => template("www_apache/vhost.include.erb"),
+            notify => Service["apache2"];
+        $docroot: ensure => directory
     }
 
-    net_analyzer::direct_service { "HTTP /":
-        command => "http!-e 302"
+    if $ssl {
+        # ssl keys must be managed manually
+        file {
+            "/etc/ssl/$vhost.crt": mode => 0622;
+            "/etc/ssl/$vhost.key": mode => 0600
+        }
     }
 
 }

Modified:
gocept.infrastructure/testing/puppet/modules/www_nginx/manifests/nginx.pp
==============================================================================
---
gocept.infrastructure/testing/puppet/modules/www_nginx/manifests/nginx.pp	(original)
+++
gocept.infrastructure/testing/puppet/modules/www_nginx/manifests/nginx.pp	Fri
Nov 28 12:44:55 2008
(at)(at) -18,11 +18,12 (at)(at)
                File["/etc/nginx/nginx.conf"]]
     }
 
-    net_analyzer::nrpe_service { "proc nginx":
+    net_analyzer::service { "proc nginx":
+        type => "nrpe",
         command => "check_procs -w 1:5 -c 1:10 -C nginx -u nginx"
     }
 
-    net_analyzer::direct_service { "HTTP /":
+    net_analyzer::service { "HTTP /":
         command => "http!-e 302"
     }
 

Modified: gocept.infrastructure/testing/puppet/util/node.sh
==============================================================================
--- gocept.infrastructure/testing/puppet/util/node.sh	(original)
+++ gocept.infrastructure/testing/puppet/util/node.sh	Fri Nov 28 12:44:55 2008
(at)(at) -9,4 +9,7 (at)(at)
     exit 1
 fi
 
-cat /home/puppet/directory/nodes/${node}
+# prefer short form
+short=${node%%.*}
+cat /home/puppet/directory/nodes/${short} 2>/dev/null && exit 0
+cat /home/puppet/directory/nodes/${node} && exit 0

MailBoxer