]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/debian-org/manifests/init.pp
stop making all that noise
[dsa-puppet.git] / modules / debian-org / manifests / init.pp
1 class debian-org {
2
3         $debianadmin = [
4                 'debian-archive-debian-samhain-reports@master.debian.org',
5                 'debian-admin@ftbfs.de',
6                 'weasel@debian.org',
7                 'steve@lobefin.net',
8                 'paravoid@debian.org'
9         ]
10
11         package { [
12                         'klogd',
13                         'sysklogd',
14                         'rsyslog',
15                 ]:
16                         ensure => purged,
17         }
18         package { [
19                         'apt-utils',
20                         'bash-completion',
21                         'debian.org',
22                         'dnsutils',
23                         'dsa-munin-plugins',
24                         'less',
25                         'lsb-release',
26                         'libfilesystem-ruby1.8',
27                         'molly-guard',
28                         'mtr-tiny',
29                         'nload',
30                         'pciutils',
31                 ]:
32                         ensure => installed,
33         }
34
35         munin::check { [
36                         'cpu',
37                         'entropy',
38                         'forks',
39                         'interrupts',
40                         'iostat',
41                         'irqstats',
42                         'load',
43                         'memory',
44                         'ntp_offset',
45                         'ntp_states',
46                         'open_files',
47                         'open_inodes',
48                         'processes',
49                         'swap',
50                         'uptime',
51                         'vmstat',
52                 ]:
53         }
54
55         if getfromhash($site::nodeinfo, 'broken-rtc') {
56                 package { 'fake-hwclock':
57                         ensure => installed
58                 }
59         }
60
61         # This really means 'not wheezy'
62
63         if $::debarchitecture != 'armhf' {
64                 site::aptrepo { 'security':
65                         template => 'debian-org/etc/apt/sources.list.d/security.list.erb',
66                 }
67                 site::aptrepo { 'backports.debian.org':
68                         template => 'debian-org/etc/apt/sources.list.d/backports.debian.org.list.erb',
69                 }
70                 site::aptrepo { 'volatile':
71                         noop     => true,
72                         template => 'debian-org/etc/apt/sources.list.d/volatile.list.erb',
73                 }
74         }
75         site::aptrepo { 'backports.org':
76                 ensure => absent,
77                 keyid => '16BA136C',
78                 key => 'puppet:///modules/debian-org/backports.org.asc',
79         }
80
81         site::aptrepo { 'debian.org':
82                 ensure => absent,
83         }
84
85         site::aptrepo { 'db.debian.org':
86                 template => 'debian-org/etc/apt/sources.list.d/debian.org.list.erb',
87                 key      => 'puppet:///modules/debian-org/db.debian.org.asc',
88         }
89
90         file { '/etc/apt/preferences':
91                 source => 'puppet:///modules/debian-org/apt.preferences',
92         }
93         file { '/etc/apt/trusted-keys.d/':
94                 ensure => directory,
95                 purge  => true,
96         }
97         file { '/etc/apt/apt.conf.d/local-compression':
98                 source => 'puppet:///modules/debian-org/apt.conf.d/local-compression',
99         }
100         file { '/etc/apt/apt.conf.d/local-recommends':
101                 source => 'puppet:///modules/debian-org/apt.conf.d/local-recommends',
102         }
103         file { '/etc/apt/apt.conf.d/local-pdiffs':
104                 source => 'puppet:///modules/debian-org/apt.conf.d/local-pdiffs',
105         }
106         file { '/etc/timezone':
107                 source => 'puppet:///modules/debian-org/timezone',
108                 notify => Exec['dpkg-reconfigure tzdata -pcritical -fnoninteractive'],
109         }
110         file { '/etc/puppet/puppet.conf':
111                 source => 'puppet:///modules/debian-org/puppet.conf',
112         }
113         file { '/etc/default/puppet':
114                 source => 'puppet:///modules/debian-org/puppet.default',
115         }
116         file { '/etc/cron.d/dsa-puppet-stuff':
117                 source => 'puppet:///modules/debian-org/dsa-puppet-stuff.cron',
118                 require => Package['debian.org'],
119         }
120         file { '/etc/ldap/ldap.conf':
121                 require => Package['debian.org'],
122                 source => 'puppet:///modules/debian-org/ldap.conf',
123         }
124         file { '/etc/pam.d/common-session':
125                 require => Package['debian.org'],
126                 content => template('debian-org/pam.common-session.erb'),
127         }
128         file { '/etc/rc.local':
129                 mode   => '0755',
130                 source => 'puppet:///modules/debian-org/rc.local',
131                 notify => Exec['rc.local start'],
132         }
133         file { '/etc/molly-guard/run.d/15-acquire-reboot-lock':
134                 mode    => '0755',
135                 source  => 'puppet:///modules/debian-org/molly-guard-acquire-reboot-lock',
136                 require => Package['molly-guard'],
137         }
138         file { '/etc/dsa':
139                 ensure => directory,
140                 mode   => '0755',
141         }
142         file { '/etc/dsa/cron.ignore.dsa-puppet-stuff':
143                 source  => 'puppet:///modules/debian-org/dsa-puppet-stuff.cron.ignore',
144                 require => Package['debian.org']
145         }
146
147         # set mmap_min_addr to 4096 to mitigate
148         # Linux NULL-pointer dereference exploits
149         site::sysctl { 'mmap_min_addr':
150                 key   => 'vm.mmap_min_addr',
151                 value => '4096',
152         }
153         site::alternative { 'editor':
154                 linkto => '/usr/bin/vim.basic',
155         }
156         mailalias { 'samhain-reports':
157                 ensure => present,
158                 recipient => $debianadmin,
159         }
160
161         exec { 'apt-get update':
162                 path        => '/usr/bin:/usr/sbin:/bin:/sbin',
163                 refreshonly => true,
164         }-> Package <| |>
165
166         exec { 'dpkg-reconfigure tzdata -pcritical -fnoninteractive':
167                 path        => '/usr/bin:/usr/sbin:/bin:/sbin',
168                 refreshonly => true
169         }
170         exec { 'puppetmaster restart':
171                 path        => '/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin',
172                 refreshonly => true
173         }
174         exec { 'rc.local start':
175                 path        => '/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin',
176                 refreshonly => true
177         }
178         exec { 'init q':
179                 refreshonly => true
180         }
181 }