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