Put the puppet motd into /etc/motd on stretch hosts
[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         file { '/etc/motd.tail':
11                 ensure => absent,
12         }
13
14         if versioncmp($::lsbmajdistrelease, '9') < 0 {
15                 file { '/etc/motd':
16                         ensure => link,
17                         target => '/var/run/motd'
18                 }
19                 file { '/etc/update-motd.d':
20                         ensure => directory,
21                         mode   => '0755'
22                 }
23                 file { '/etc/update-motd.d/puppet-motd':
24                         notify  => undef,
25                         mode    => '0555',
26                         content => template('motd/motd.erb')
27                 }
28         } else {
29                 file { '/etc/update-motd.d/puppet-motd':
30                         ensure => absent,
31                 }
32                 file { '/etc/motd':
33                         notify  => undef,
34                         content => template('motd/motd.erb')
35                 }
36         }
37 }