]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/motd/manifests/init.pp
Make it work with jessie, II
[dsa-puppet.git] / modules / motd / manifests / init.pp
index 6f95ff6068b149fef8af7676faa8311ea39590b2..5f017c912950d404ed3a253911735d98ec347194 100644 (file)
@@ -7,30 +7,28 @@
 #   include motd
 #
 class motd {
-
-       if $::lsbdistcodename == 'wheezy' {
+       if $::lsbmajdistrelease == "testing" or $::lsbmajdistrelease >= 7 {
                $fname  = '/etc/update-motd.d/puppet-motd'
                $notify = undef
                $mode   = '0555'
 
-               file { '/etc/motd':
-                       ensure  => present,
-                       replace => false
+               file { '/etc/update-motd.d':
+                       ensure => directory,
+                       mode   => '0755'
                }
-
-       } elsif $::lsbdistcodename == 'squeeze' {
+               file { '/etc/motd.tail':
+                       ensure => absent,
+               }
+       } else {
                $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,
-               }
+       }
+
+       file { '/etc/motd':
+               ensure => link,
+               target => '/var/run/motd'
        }
 
        file { $fname:
@@ -38,4 +36,9 @@ class motd {
                mode    => $mode,
                content => template('motd/motd.erb')
        }
+
+       exec { 'updatemotd':
+               command     => 'uname -snrvm > /var/run/motd && cat /etc/motd.tail >> /var/run/motd',
+               refreshonly => true,
+       }
 }