]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Begin cleaning up templates into the module namespace - I think we're
authorStephen Gran <steve@lobefin.net>
Sun, 26 Apr 2009 16:00:19 +0000 (17:00 +0100)
committerStephen Gran <steve@lobefin.net>
Sun, 26 Apr 2009 16:00:19 +0000 (17:00 +0100)
going to be using a lot more templates in the future
Signed-off-by: Stephen Gran <steve@lobefin.net>
modules/motd/manifests/init.pp
modules/motd/templates/motd.erb [new file with mode: 0644]
templates/motd.erb [deleted file]

index 9fedde753d21a0744284c15b70eced1eb07e0163..fb2a20e946800f45089aef1e619e5351e304fe2f 100644 (file)
@@ -1,7 +1,7 @@
 class motd {
        file { "/etc/motd.tail":
                 notify  => Exec["updatemotd"],
-                content => template("motd.erb") ;
+                content => template("motd/motd.erb") ;
        }
         exec { "updatemotd":
                 command => "uname -snrvm > /var/run/motd && cat /etc/motd.tail >> /var/run/motd",
diff --git a/modules/motd/templates/motd.erb b/modules/motd/templates/motd.erb
new file mode 100644 (file)
index 0000000..b186dc9
--- /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 ' + fqdn
+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'].sort.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
+-%>
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/templates/motd.erb b/templates/motd.erb
deleted file mode 100644 (file)
index b186dc9..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-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 ' + fqdn
-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'].sort.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
--%>
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%