From 5275770968b17ca00ae43f19c92ffa825cda6f71 Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sun, 7 Oct 2012 15:58:13 +0100 Subject: [PATCH] add wheezy support Signed-off-by: Stephen Gran --- modules/motd/manifests/init.pp | 37 ++++++++++++++++++++++++--------- modules/motd/templates/motd.erb | 8 +++++++ 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/modules/motd/manifests/init.pp b/modules/motd/manifests/init.pp index e8e6bcc0f..6f95ff606 100644 --- a/modules/motd/manifests/init.pp +++ b/modules/motd/manifests/init.pp @@ -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') } } diff --git a/modules/motd/templates/motd.erb b/modules/motd/templates/motd.erb index e18d58ce3..862260229 100644 --- a/modules/motd/templates/motd.erb +++ b/modules/motd/templates/motd.erb @@ -1,3 +1,8 @@ +<% if @lsbdistcodename == 'wheezy' -%> +#!/bin/bash + +cat < 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: -- 2.20.1