3 # Stuff common to all debian.org servers
6 if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') {
7 $mirror = getfromhash($site::nodeinfo, 'hoster', 'mirror-debian')
9 $mirror = 'http://ftp.debian.org/debian/'
11 if $::lsbmajdistrelease < 7 {
12 $mirror_backports = 'http://backports.debian.org/debian-backports/'
14 $mirror_backports = $mirror
17 if $::lsbmajdistrelease <= 7 {
18 $mungedcodename = $::lsbdistcodename
19 } elsif ($::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) {
20 $mungedcodename = "${::lsbdistcodename}-kfreebsd"
22 $mungedcodename = $::lsbdistcodename
27 $servicefiles = 'present'
29 $servicefiles = 'absent'
33 'debian-archive-debian-samhain-reports@master.debian.org',
34 'debian-admin@ftbfs.de',
37 'paravoid@debian.org',
57 file { '/etc/ssh/ssh_known_hosts':
61 source => 'puppet:///modules/debian-org/basic-ssh_known_hosts'
70 'libfilesystem-ruby1.8',
78 if $::lsbmajdistrelease == 7 {
79 package { 'libfilesystem-ruby1.9.1':
82 } elsif $::lsbmajdistrelease >= 8 {
83 package { 'ruby-filesystem':
108 if getfromhash($site::nodeinfo, 'broken-rtc') {
109 package { 'fake-hwclock':
115 package { 'molly-guard':
118 file { '/etc/molly-guard/run.d/10-check-kvm':
120 source => 'puppet:///modules/debian-org/molly-guard/10-check-kvm',
121 require => Package['molly-guard'],
123 file { '/etc/molly-guard/run.d/15-acquire-reboot-lock':
125 source => 'puppet:///modules/debian-org/molly-guard/15-acquire-reboot-lock',
126 require => Package['molly-guard'],
129 file { '/etc/apt/trusted-keys.d':
134 file { '/etc/apt/trusted.gpg':
139 site::aptrepo { 'security':
140 url => 'http://security.debian.org/',
141 suite => "${mungedcodename}/updates",
142 components => ['main','contrib','non-free']
144 if $::lsbmajdistrelease < 7 {
145 site::aptrepo { 'debian-lts':
147 suite => "${::lsbdistcodename}-lts",
148 components => ['main','contrib','non-free']
151 site::aptrepo { 'debian-lts':
156 site::aptrepo { 'backports.debian.org':
157 url => $mirror_backports,
158 suite => "${::lsbdistcodename}-backports",
159 components => ['main','contrib','non-free']
162 if (($::lsbmajdistrelease) >= 8 and ($::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386'])) {
163 site::aptrepo { 'volatile':
167 site::aptrepo { 'volatile':
169 suite => "${::lsbdistcodename}-updates",
170 components => ['main','contrib','non-free']
174 #if ($::hostname in [ball, corelli, eysler, lucatelli, mayer, mayr, pettersson]) or
175 # ($::hoster and ($::hoster in [bytemark, man-da, brown])) {
176 # site::aptrepo { 'proposed-updates':
178 # suite => "${::lsbdistcodename}-proposed-updates",
179 # components => ['main','contrib','non-free']
182 site::aptrepo { 'proposed-updates':
187 site::aptrepo { 'debian.org':
191 site::aptrepo { 'db.debian.org':
192 url => 'http://db.debian.org/debian-admin',
193 suite => 'debian-all',
194 components => 'main',
195 key => 'puppet:///modules/debian-org/db.debian.org.gpg',
197 site::aptrepo { 'db.debian.org-suite':
198 url => 'http://db.debian.org/debian-admin',
199 suite => $::lsbdistcodename,
200 components => 'main',
203 augeas { 'inittab_replicate':
204 context => '/files/etc/inittab',
206 'set ud/runlevels 2345',
207 'set ud/action respawn',
208 'set ud/process "/usr/bin/ud-replicated -d"',
210 notify => Exec['init q'],
213 if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') {
214 site::aptrepo { 'debian':
215 url => getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'),
216 suite => $mungedcodename,
217 components => ['main','contrib','non-free']
221 file { '/etc/facter':
226 source => 'puppet:///files/empty/',
228 file { '/etc/facter/facts.d':
231 file { '/etc/facter/facts.d/debian_facts.yaml':
232 content => template('debian-org/debian_facts.yaml.erb')
234 file { '/etc/apt/preferences':
235 source => 'puppet:///modules/debian-org/apt.preferences',
237 file { '/etc/apt/apt.conf.d/local-compression':
238 source => 'puppet:///modules/debian-org/apt.conf.d/local-compression',
240 file { '/etc/apt/apt.conf.d/local-recommends':
241 source => 'puppet:///modules/debian-org/apt.conf.d/local-recommends',
243 file { '/etc/apt/apt.conf.d/local-pdiffs':
244 source => 'puppet:///modules/debian-org/apt.conf.d/local-pdiffs',
246 file { '/etc/timezone':
247 source => 'puppet:///modules/debian-org/timezone',
248 notify => Exec['dpkg-reconfigure tzdata -pcritical -fnoninteractive'],
250 if $::hostname == handel {
251 include puppetmaster::db
252 $dbpassword = $puppetmaster::db::password
254 file { '/etc/puppet/puppet.conf':
255 content => template('debian-org/puppet.conf.erb'),
257 file { '/etc/default/puppet':
258 source => 'puppet:///modules/debian-org/puppet.default',
260 file { '/etc/systemd':
264 file { '/etc/systemd/system':
268 file { '/etc/systemd/system/ud-replicated.service':
269 ensure => $servicefiles,
270 source => 'puppet:///modules/debian-org/ud-replicated.service',
271 notify => Exec['systemctl daemon-reload'],
274 file { '/etc/systemd/system/multi-user.target.wants/ud-replicated.service':
276 target => '../ud-replicated.service',
277 notify => Exec['systemctl daemon-reload'],
280 file { '/etc/systemd/system/puppet.service':
282 target => '/dev/null',
283 notify => Exec['systemctl daemon-reload'],
286 file { '/etc/cron.d/dsa-puppet-stuff':
287 content => template('debian-org/dsa-puppet-stuff.cron.erb'),
288 require => Package['debian.org'],
290 file { '/etc/ldap/ldap.conf':
291 require => Package['debian.org'],
292 source => 'puppet:///modules/debian-org/ldap.conf',
294 file { '/etc/pam.d/common-session':
295 require => Package['debian.org'],
296 content => template('debian-org/pam.common-session.erb'),
298 file { '/etc/pam.d/common-session-noninteractive':
299 require => Package['debian.org'],
300 content => template('debian-org/pam.common-session-noninteractive.erb'),
302 file { '/etc/rc.local':
304 content => template('debian-org/rc.local.erb'),
305 notify => Exec['service rc.local start'],
311 file { '/etc/dsa/cron.ignore.dsa-puppet-stuff':
312 source => 'puppet:///modules/debian-org/dsa-puppet-stuff.cron.ignore',
313 require => Package['debian.org']
315 file { '/etc/nsswitch.conf':
317 source => 'puppet:///modules/debian-org/nsswitch.conf',
320 # set mmap_min_addr to 4096 to mitigate
321 # Linux NULL-pointer dereference exploits
322 site::sysctl { 'mmap_min_addr':
325 site::sysctl { 'perf_event_paranoid':
326 key => 'kernel.perf_event_paranoid',
329 site::alternative { 'editor':
330 linkto => '/usr/bin/vim.basic',
332 site::alternative { 'view':
333 linkto => '/usr/bin/vim.basic',
335 mailalias { 'samhain-reports':
337 recipient => $debianadmin,
338 require => Package['debian.org']
341 file { '/usr/local/bin/check_for_updates':
342 source => 'puppet:///modules/debian-org/check_for_updates',
348 exec { 'apt-get update':
349 path => '/usr/bin:/usr/sbin:/bin:/sbin',
350 onlyif => '/usr/local/bin/check_for_updates',
351 require => File['/usr/local/bin/check_for_updates']
353 Exec['apt-get update']->Package<| tag == extra_repo |>
355 exec { 'dpkg-reconfigure tzdata -pcritical -fnoninteractive':
356 path => '/usr/bin:/usr/sbin:/bin:/sbin',
359 exec { 'service puppetmaster restart':
362 exec { 'service rc.local start':
369 exec { 'systemctl daemon-reload':
371 onlyif => "test -x /bin/systemctl"
374 tidy { '/var/lib/puppet/clientbucket/':
378 matches => [ 'paths', 'contents' ],
382 file { '/root/.bashrc':
383 source => 'puppet:///modules/debian-org/root-dotfiles/bashrc',
385 file { '/root/.profile':
386 source => 'puppet:///modules/debian-org/root-dotfiles/profile',
388 file { '/root/.screenrc':
389 source => 'puppet:///modules/debian-org/root-dotfiles/screenrc',
391 file { '/root/.vimrc':
392 source => 'puppet:///modules/debian-org/root-dotfiles/vimrc',