From 71127bee2ef446cee2444cf2ab360c459db9b5a8 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 28 Aug 2017 14:06:20 +0200 Subject: [PATCH] Put the puppet motd into /etc/motd on stretch hosts --- modules/motd/manifests/init.pp | 26 ++++++++++++++------------ modules/motd/templates/motd.erb | 4 ++++ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/modules/motd/manifests/init.pp b/modules/motd/manifests/init.pp index 3bf224b79..d8fba15db 100644 --- a/modules/motd/manifests/init.pp +++ b/modules/motd/manifests/init.pp @@ -7,10 +7,6 @@ # include motd # class motd { - file { '/etc/update-motd.d': - ensure => directory, - mode => '0755' - } file { '/etc/motd.tail': ensure => absent, } @@ -20,16 +16,22 @@ class motd { ensure => link, target => '/var/run/motd' } + file { '/etc/update-motd.d': + ensure => directory, + mode => '0755' + } + file { '/etc/update-motd.d/puppet-motd': + notify => undef, + mode => '0555', + content => template('motd/motd.erb') + } } else { + file { '/etc/update-motd.d/puppet-motd': + ensure => absent, + } file { '/etc/motd': - ensure => link, - target => '/run/motd.dynamic' + notify => undef, + content => template('motd/motd.erb') } } - - file { '/etc/update-motd.d/puppet-motd': - notify => undef, - mode => '0555', - content => template('motd/motd.erb') - } } diff --git a/modules/motd/templates/motd.erb b/modules/motd/templates/motd.erb index f078a5f45..bd50962e1 100644 --- a/modules/motd/templates/motd.erb +++ b/modules/motd/templates/motd.erb @@ -1,6 +1,8 @@ +<%- if scope.call_function('versioncmp', [@lsbmajdistrelease, '8']) <= 0 -%> #!/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 @@ -141,7 +143,9 @@ purp -%> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +<%- if scope.call_function('versioncmp', [@lsbmajdistrelease, '8']) <= 0 -%> EOD +<%- end -%> <% # vim:set et: # vim:set sts=2 ts=2: -- 2.20.1