X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=modules%2Fmotd%2Fmanifests%2Finit.pp;h=5f017c912950d404ed3a253911735d98ec347194;hb=2d2d25eb5b5c376c5f73551fa11f5acaf866a60d;hp=0de4936028982dcef035393442d4fe724e922ba0;hpb=7f86914b9cb237cb1cf8c720f86902bef717cfaa;p=dsa-puppet.git diff --git a/modules/motd/manifests/init.pp b/modules/motd/manifests/init.pp index 0de49360..5f017c91 100644 --- a/modules/motd/manifests/init.pp +++ b/modules/motd/manifests/init.pp @@ -1,15 +1,44 @@ +# = Class: motd +# +# This class configures a sensible motd +# +# == Sample Usage: +# +# include motd +# class motd { - file { "/etc/motd.tail": - notify => Exec["updatemotd"], - content => template("motd/motd.erb") ; - "/etc/motd": - ensure => "/var/run/motd"; - } - exec { "updatemotd": - command => "uname -snrvm > /var/run/motd && cat /etc/motd.tail >> /var/run/motd", - refreshonly => true - } + 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': + 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, + } } -# vim:set et: -# vim:set sts=4 ts=4: -# vim:set shiftwidth=4: