]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/motd/manifests/init.pp
some tidy up
[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                 file { '/etc/update-motd.d':
17                         ensure => directory,
18                 }
19
20         } elsif $::lsbdistcodename == 'squeeze' {
21                 $fname  = '/etc/motd.tail'
22                 $notify = Exec['updatemotd']
23                 $mode   = '0444'
24
25         }
26
27         file { '/etc/motd':
28                 ensure => link,
29                 target => '/var/run/motd'
30         }
31
32         file { $fname:
33                 notify  => $notify,
34                 mode    => $mode,
35                 content => template('motd/motd.erb')
36         }
37
38         exec { 'updatemotd':
39                 command     => 'uname -snrvm > /var/run/motd && cat /etc/motd.tail >> /var/run/motd',
40                 refreshonly => true,
41         }
42 }