From: Peter Palfrader Date: Mon, 28 Aug 2017 12:06:20 +0000 (+0200) Subject: Put the puppet motd into /etc/motd on stretch hosts X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=71127bee2ef446cee2444cf2ab360c459db9b5a8;p=mirror%2Fdsa-puppet.git Put the puppet motd into /etc/motd on stretch hosts --- 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: