]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/debian-org/manifests/init.pp
update sources.lists for wheezy
[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                         'debian.org',
20                         'dsa-munin-plugins',
21                 ]:
22                 ensure => installed,
23                 require => [
24                         File['/etc/apt/sources.list.d/db.debian.org.list'],
25                         Exec['apt-get update']
26                 ]
27         }
28         package { [
29                         'apt-utils',
30                         'bash-completion',
31                         'dnsutils',
32                         'less',
33                         'lsb-release',
34                         'libfilesystem-ruby1.8',
35                         'mtr-tiny',
36                         'nload',
37                         'pciutils',
38                 ]:
39                 ensure => installed,
40         }
41
42         munin::check { [
43                         'cpu',
44                         'entropy',
45                         'forks',
46                         'interrupts',
47                         'iostat',
48                         'irqstats',
49                         'load',
50                         'memory',
51                         'ntp_offset',
52                         'ntp_states',
53                         'open_files',
54                         'open_inodes',
55                         'processes',
56                         'swap',
57                         'uptime',
58                         'vmstat',
59                 ]:
60         }
61
62         if getfromhash($site::nodeinfo, 'broken-rtc') {
63                 package { 'fake-hwclock':
64                         ensure => installed,
65                         require => [
66                                 File['/etc/apt/sources.list.d/db.debian.org.list'],
67                                 Exec['apt-get update']
68                         ]
69                 }
70         }
71
72         package { 'molly-guard':
73                 ensure => installed,
74         }
75         file { '/etc/molly-guard/run.d/10-check-kvm':
76                 mode    => '0755',
77                 source  => 'puppet:///modules/debian-org/molly-guard/10-check-kvm',
78                 require => Package['molly-guard'],
79         }
80         file { '/etc/molly-guard/run.d/15-acquire-reboot-lock':
81                 mode    => '0755',
82                 source  => 'puppet:///modules/debian-org/molly-guard/15-acquire-reboot-lock',
83                 require => Package['molly-guard'],
84         }
85
86         site::aptrepo { 'security':
87                 url        => 'http://security.debian.org/',
88                 suite      => "${::lsbdistcodename}/updates",
89                 components => ['main','contrib','non-free']
90         }
91
92         if $::lsbdistcodename != 'wheezy' {
93                 site::aptrepo { 'backports.debian.org':
94                         url        => 'http://backports.debian.org/debian-backports/',
95                         suite      => "${::lsbdistcodename}-backports",
96                         components => ['main','contrib','non-free']
97                 }
98
99                 if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') {
100                         site::aptrepo { 'volatile':
101                                 url        => getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'),
102                                 suite      => "${::lsbdistcodename}-updates",
103                                 components => ['main','contrib','non-free']
104                         }
105                 } else {
106                         site::aptrepo { 'volatile':
107                                 url        => 'http://ftp.debian.org/debian',
108                                 suite      => "${::lsbdistcodename}-updates",
109                                 components => ['main','contrib','non-free']
110                         }
111                 }
112         }
113         site::aptrepo { 'backports.org':
114                 ensure => absent,
115                 keyid => '16BA136C',
116                 key => 'puppet:///modules/debian-org/backports.org.asc',
117         }
118
119         site::aptrepo { 'debian.org':
120                 ensure => absent,
121         }
122
123         site::aptrepo { 'db.debian.org':
124                 url        => 'http://db.debian.org/debian-admin',
125                 suite      => 'lenny',
126                 components => 'main',
127                 key        => 'puppet:///modules/debian-org/db.debian.org.asc',
128         }
129
130         if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') {
131                 site::aptrepo { 'debian':
132                         url        => getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'),
133                         suite      => $::lsbdistcodename,
134                         components => ['main','contrib','non-free']
135                 }
136         }
137
138         file { '/etc/facter':
139                 ensure  => directory,
140                 purge   => true,
141                 force   => true,
142                 recurse => true,
143                 source  => 'puppet:///files/empty/',
144         }
145         file { '/etc/facter/facts.d':
146                 ensure => directory,
147         }
148         file { '/etc/facter/facts.d/debian_facts.yaml':
149                 content => template('debian-org/debian_facts.yaml.erb')
150         }
151         file { '/etc/apt/preferences':
152                 source => 'puppet:///modules/debian-org/apt.preferences',
153         }
154         file { '/etc/apt/trusted-keys.d/':
155                 ensure => directory,
156                 purge  => true,
157         }
158         file { '/etc/apt/apt.conf.d/local-compression':
159                 source => 'puppet:///modules/debian-org/apt.conf.d/local-compression',
160         }
161         file { '/etc/apt/apt.conf.d/local-recommends':
162                 source => 'puppet:///modules/debian-org/apt.conf.d/local-recommends',
163         }
164         file { '/etc/apt/apt.conf.d/local-pdiffs':
165                 source => 'puppet:///modules/debian-org/apt.conf.d/local-pdiffs',
166         }
167         file { '/etc/timezone':
168                 source => 'puppet:///modules/debian-org/timezone',
169                 notify => Exec['dpkg-reconfigure tzdata -pcritical -fnoninteractive'],
170         }
171         if $::hostname == handel {
172                 include puppetmaster::db
173                 $dbpassword = $puppetmaster::db::password
174         }
175         file { '/etc/puppet/puppet.conf':
176                 content => template('debian-org/puppet.conf.erb'),
177         }
178         file { '/etc/default/puppet':
179                 source => 'puppet:///modules/debian-org/puppet.default',
180         }
181         file { '/etc/cron.d/dsa-puppet-stuff':
182                 source => 'puppet:///modules/debian-org/dsa-puppet-stuff.cron',
183                 require => Package['debian.org'],
184         }
185         file { '/etc/ldap/ldap.conf':
186                 require => Package['debian.org'],
187                 source => 'puppet:///modules/debian-org/ldap.conf',
188         }
189         file { '/etc/pam.d/common-session':
190                 require => Package['debian.org'],
191                 content => template('debian-org/pam.common-session.erb'),
192         }
193         file { '/etc/pam.d/common-session-noninteractive':
194                 require => Package['debian.org'],
195                 content => template('debian-org/pam.common-session-noninteractive.erb'),
196         }
197         file { '/etc/rc.local':
198                 mode   => '0755',
199                 source => 'puppet:///modules/debian-org/rc.local',
200                 notify => Exec['rc.local start'],
201         }
202         file { '/etc/dsa':
203                 ensure => directory,
204                 mode   => '0755',
205         }
206         file { '/etc/dsa/cron.ignore.dsa-puppet-stuff':
207                 source  => 'puppet:///modules/debian-org/dsa-puppet-stuff.cron.ignore',
208                 require => Package['debian.org']
209         }
210
211         # set mmap_min_addr to 4096 to mitigate
212         # Linux NULL-pointer dereference exploits
213         site::sysctl { 'mmap_min_addr':
214                 key   => 'vm.mmap_min_addr',
215                 value => '4096',
216         }
217         site::alternative { 'editor':
218                 linkto => '/usr/bin/vim.basic',
219         }
220         site::alternative { 'view':
221                 linkto => '/usr/bin/vim.basic',
222         }
223         mailalias { 'samhain-reports':
224                 ensure => present,
225                 recipient => $debianadmin,
226                 require => Package['debian.org']
227         }
228
229         exec { 'apt-get update':
230                 path        => '/usr/bin:/usr/sbin:/bin:/sbin',
231                 refreshonly => true,
232         }
233
234         exec { 'dpkg-reconfigure tzdata -pcritical -fnoninteractive':
235                 path        => '/usr/bin:/usr/sbin:/bin:/sbin',
236                 refreshonly => true
237         }
238         exec { 'puppetmaster restart':
239                 path        => '/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin',
240                 refreshonly => true
241         }
242         exec { 'rc.local start':
243                 path        => '/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin',
244                 refreshonly => true
245         }
246         exec { 'init q':
247                 refreshonly => true
248         }
249 }