add wheezy support
authorStephen Gran <steve@lobefin.net>
Sun, 7 Oct 2012 14:58:13 +0000 (15:58 +0100)
committerStephen Gran <steve@lobefin.net>
Sun, 7 Oct 2012 14:58:13 +0000 (15:58 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
modules/motd/manifests/init.pp
modules/motd/templates/motd.erb

index e8e6bcc..6f95ff6 100644 (file)
@@ -8,17 +8,34 @@
 #
 class motd {
 
-       file { '/etc/motd.tail':
-               notify  => Exec['updatemotd'],
-               content => template('motd/motd.erb')
-       }
-       file { '/etc/motd':
-               ensure => link,
-               target => '/var/run/motd'
+       if $::lsbdistcodename == 'wheezy' {
+               $fname  = '/etc/update-motd.d/puppet-motd'
+               $notify = undef
+               $mode   = '0555'
+
+               file { '/etc/motd':
+                       ensure  => present,
+                       replace => false
+               }
+
+       } elsif $::lsbdistcodename == 'squeeze' {
+               $fname  = '/etc/motd.tail'
+               $notify = Exec['updatemotd']
+               $mode   = '0444'
+
+               file { '/etc/motd':
+                       ensure => link,
+                       target => '/var/run/motd'
+               }
+               exec { 'updatemotd':
+                       command     => 'uname -snrvm > /var/run/motd && cat /etc/motd.tail >> /var/run/motd',
+                       refreshonly => true,
+               }
        }
 
-       exec { 'updatemotd':
-               command     => 'uname -snrvm > /var/run/motd && cat /etc/motd.tail >> /var/run/motd',
-               refreshonly => true,
+       file { $fname:
+               notify  => $notify,
+               mode    => $mode,
+               content => template('motd/motd.erb')
        }
 }
index e18d58c..8622602 100644 (file)
@@ -1,3 +1,8 @@
+<% if @lsbdistcodename == 'wheezy' -%>
+#!/bin/bash
+
+cat <<EOD
+<% end -%>
 
 This device is for authorized users only.  All traffic on this device
 is monitored and will be used as evidence for prosecutions.  By using
@@ -130,6 +135,9 @@ purp
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+<% if @lsbdistcodename == 'wheezy' -%>
+EOD
+<% end -%>
 <%
 # vim:set et:
 # vim:set sts=2 ts=2: