]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Lets give this a try
authorStephen Gran <steve@lobefin.net>
Sun, 26 Apr 2009 15:04:38 +0000 (16:04 +0100)
committerStephen Gran <steve@lobefin.net>
Sun, 26 Apr 2009 15:04:38 +0000 (16:04 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
manifests/site.pp
templates/motd-new.erb [new file with mode: 0644]

index 91e6f59cffb52a069bf4d51a6a6b173ea0a5a8aa..0af9a890a164aca3d1379bff89124d376acabaec 100644 (file)
@@ -18,7 +18,6 @@ node default {
     include sudo
     include debian-org
     include monit
-    include motd
     include samhain
 
     $nodeinfo = nodeinfo($fqdn, "/home/sgran/local.yaml")
@@ -37,9 +36,11 @@ node default {
     case $hostname {
         spohr: {
                       include nagios::server
+                      include motd-new
         }
         default: {
                      include nagios::client
+                      include motd
        }
     }
 
diff --git a/templates/motd-new.erb b/templates/motd-new.erb
new file mode 100644 (file)
index 0000000..6f9260e
--- /dev/null
@@ -0,0 +1,55 @@
+This device is for authorized users only.  All traffic on this device
+is monitored and will be used as evidence for prosecutions.
+
+** IMPORTANT WARNING **
+
+Please read:
+
+http://lists.debian.org/debian-devel-announce/2003/debian-devel-announce-200312/msg00001.html
+
+before doing anything on these machines - especially the "What to do
+when you can login" section.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+<%=
+purp = ''
+if $nodeinfo.has_key?('nameinfo')
+  purp += $nodeinfo['nameinfo'] + "\n\n"
+end
+
+purp += 'Welcome to ' + host
+if ($nodeinfo['ldap'].at(0)) and ($nodeinfo['ldap'][0].has_key?('purpose'))
+  if $nodeinfo['ldap'][0]['purpose'].include?('buildd')
+    purp += ", the Debian "
+    if $nodeinfo['ldap'][0].has_key?('architecture')
+      purp += $nodeinfo['ldap'][0]['architecture'][0]
+    end
+    purp += " build daemon\n"
+  elsif $nodeinfo['ldap'][0]['purpose'].include?('porterbox')
+    purp += ", the Debian "
+    if $nodeinfo['ldap'][0].has_key?('architecture')
+      purp += $nodeinfo['ldap'][0]['architecture'][0]
+    end
+    purp += " porterbox\n"
+  else
+    purp += ", used for the following services:\n"
+    $nodeinfo['ldap'][0]['purpose'].each do |l|
+      if l =~ /\[\[(\*|-)?(.*?)\]\]/
+        l = $2
+      end
+      if l =~ /\[\[(.*?)\|(.*?)\]\]/
+        l = $2
+      end
+      purp += "\t" + l + "\n"
+    end
+  end
+end
+
+if $nodeinfo.has_key?('footer')
+  purp += "\n" + $nodeinfo['footer'] + "\n"
+end
+purp
+-%>
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%