no, we like the link
[mirror/dsa-puppet.git] / modules / motd / manifests / init.pp
1 # = Class: motd
2 #
3 # This class configures a sensible motd
4 #
5 # == Sample Usage:
6 #
7 #   include motd
8 #
9 class motd {
10
11         if $::lsbdistcodename == 'wheezy' {
12                 $fname  = '/etc/update-motd.d/puppet-motd'
13                 $notify = undef
14                 $mode   = '0555'
15
16         } elsif $::lsbdistcodename == 'squeeze' {
17                 $fname  = '/etc/motd.tail'
18                 $notify = Exec['updatemotd']
19                 $mode   = '0444'
20
21         }
22
23         file { '/etc/motd':
24                 ensure => link,
25                 target => '/var/run/motd'
26         }
27
28         file { $fname:
29                 notify  => $notify,
30                 mode    => $mode,
31                 content => template('motd/motd.erb')
32         }
33
34         exec { 'updatemotd':
35                 command     => 'uname -snrvm > /var/run/motd && cat /etc/motd.tail >> /var/run/motd',
36                 refreshonly => true,
37         }
38 }