From 934d3d94842414645f797059b8d607739eca94b4 Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sun, 26 Apr 2009 16:04:38 +0100 Subject: [PATCH] Lets give this a try Signed-off-by: Stephen Gran --- manifests/site.pp | 3 ++- templates/motd-new.erb | 55 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 templates/motd-new.erb diff --git a/manifests/site.pp b/manifests/site.pp index 91e6f59c..0af9a890 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -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 index 00000000..6f9260e6 --- /dev/null +++ b/templates/motd-new.erb @@ -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 +-%> + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -- 2.39.2