Put the puppet motd into /etc/motd on stretch hosts
authorPeter Palfrader <peter@palfrader.org>
Mon, 28 Aug 2017 12:06:20 +0000 (14:06 +0200)
committerPeter Palfrader <peter@palfrader.org>
Mon, 28 Aug 2017 12:06:20 +0000 (14:06 +0200)
modules/motd/manifests/init.pp
modules/motd/templates/motd.erb

index 3bf224b..d8fba15 100644 (file)
@@ -7,10 +7,6 @@
 #   include motd
 #
 class motd {
 #   include motd
 #
 class motd {
-       file { '/etc/update-motd.d':
-               ensure => directory,
-               mode   => '0755'
-       }
        file { '/etc/motd.tail':
                ensure => absent,
        }
        file { '/etc/motd.tail':
                ensure => absent,
        }
@@ -20,16 +16,22 @@ class motd {
                        ensure => link,
                        target => '/var/run/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 {
        } else {
+               file { '/etc/update-motd.d/puppet-motd':
+                       ensure => absent,
+               }
                file { '/etc/motd':
                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')
-       }
 }
 }
index f078a5f..bd50962 100644 (file)
@@ -1,6 +1,8 @@
+<%- if scope.call_function('versioncmp', [@lsbmajdistrelease, '8']) <= 0 -%>
 #!/bin/bash
 
 cat <<EOD
 #!/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
 
 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
 EOD
+<%- end -%>
 <%
 # vim:set et:
 # vim:set sts=2 ts=2:
 <%
 # vim:set et:
 # vim:set sts=2 ts=2: