]> 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 e8e6bcc0fa2033c1ea1411375b2852d275a187d0..5f017c912950d404ed3a253911735d98ec347194 100644 (file)
@@ -7,16 +7,36 @@
 #   include motd
 #
 class motd {
+       if $::lsbmajdistrelease == "testing" or $::lsbmajdistrelease >= 7 {
+               $fname  = '/etc/update-motd.d/puppet-motd'
+               $notify = undef
+               $mode   = '0555'
+
+               file { '/etc/update-motd.d':
+                       ensure => directory,
+                       mode   => '0755'
+               }
+               file { '/etc/motd.tail':
+                       ensure => absent,
+               }
+       } else {
+               $fname  = '/etc/motd.tail'
+               $notify = Exec['updatemotd']
+               $mode   = '0444'
 
-       file { '/etc/motd.tail':
-               notify  => Exec['updatemotd'],
-               content => template('motd/motd.erb')
        }
+
        file { '/etc/motd':
                ensure => link,
                target => '/var/run/motd'
        }
 
+       file { $fname:
+               notify  => $notify,
+               mode    => $mode,
+               content => template('motd/motd.erb')
+       }
+
        exec { 'updatemotd':
                command     => 'uname -snrvm > /var/run/motd && cat /etc/motd.tail >> /var/run/motd',
                refreshonly => true,