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'
64 if ($::lsbmajdistrelease >= 8) {
65 $rubyfs_package = 'ruby-filesystem'
67 $rubyfs_package = 'libfilesystem-ruby1.8'
83 if $::lsbmajdistrelease == 7 {
84 package { 'libfilesystem-ruby1.9.1':
87 } elsif $::lsbmajdistrelease >= 8 {
88 package { 'ruby-filesystem':
113 if getfromhash($site::nodeinfo, 'broken-rtc') {
114 package { 'fake-hwclock':
120 package { 'molly-guard':
123 file { '/etc/molly-guard/run.d/10-check-kvm':
125 source => 'puppet:///modules/debian-org/molly-guard/10-check-kvm',
126 require => Package['molly-guard'],
128 file { '/etc/molly-guard/run.d/15-acquire-reboot-lock':
130 source => 'puppet:///modules/debian-org/molly-guard/15-acquire-reboot-lock',
131 require => Package['molly-guard'],
134 file { '/etc/apt/trusted-keys.d':
139 file { '/etc/apt/trusted.gpg':
144 site::aptrepo { 'security':
145 url => 'http://security.debian.org/',
146 suite => "${mungedcodename}/updates",
147 components => ['main','contrib','non-free']
149 if $::lsbmajdistrelease < 7 {
150 site::aptrepo { 'debian-lts':
152 suite => "${::lsbdistcodename}-lts",
153 components => ['main','contrib','non-free']
156 site::aptrepo { 'debian-lts':
161 site::aptrepo { 'backports.debian.org':
162 url => $mirror_backports,
163 suite => "${::lsbdistcodename}-backports",
164 components => ['main','contrib','non-free']
167 site::aptrepo { 'volatile':
169 suite => "${::lsbdistcodename}-updates",
170 components => ['main','contrib','non-free']
173 #if ($::hostname in [ball, corelli, eysler, lucatelli, mayer, mayr, pettersson]) or
174 # ($::hoster and ($::hoster in [bytemark, man-da, brown])) {
175 # site::aptrepo { 'proposed-updates':
177 # suite => "${::lsbdistcodename}-proposed-updates",
178 # components => ['main','contrib','non-free']
181 site::aptrepo { 'proposed-updates':
186 site::aptrepo { 'debian.org':
190 site::aptrepo { 'db.debian.org':
191 url => 'http://db.debian.org/debian-admin',
192 suite => 'debian-all',
193 components => 'main',
194 key => 'puppet:///modules/debian-org/db.debian.org.gpg',
196 site::aptrepo { 'db.debian.org-suite':
197 url => 'http://db.debian.org/debian-admin',
198 suite => $::lsbdistcodename,
199 components => 'main',
202 augeas { 'inittab_replicate':
203 context => '/files/etc/inittab',
205 'set ud/runlevels 2345',
206 'set ud/action respawn',
207 'set ud/process "/usr/bin/ud-replicated -d"',
209 notify => Exec['init q'],
212 if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') {
213 site::aptrepo { 'debian':
214 url => getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'),
215 suite => $mungedcodename,
216 components => ['main','contrib','non-free']
220 file { '/etc/facter':
225 source => 'puppet:///files/empty/',
227 file { '/etc/facter/facts.d':
230 file { '/etc/facter/facts.d/debian_facts.yaml':
231 content => template('debian-org/debian_facts.yaml.erb')
233 file { '/etc/apt/preferences':
234 source => 'puppet:///modules/debian-org/apt.preferences',
236 file { '/etc/apt/apt.conf.d/local-compression':
237 source => 'puppet:///modules/debian-org/apt.conf.d/local-compression',
239 file { '/etc/apt/apt.conf.d/local-recommends':
240 source => 'puppet:///modules/debian-org/apt.conf.d/local-recommends',
242 file { '/etc/apt/apt.conf.d/local-pdiffs':
243 source => 'puppet:///modules/debian-org/apt.conf.d/local-pdiffs',
245 file { '/etc/timezone':
246 source => 'puppet:///modules/debian-org/timezone',
247 notify => Exec['dpkg-reconfigure tzdata -pcritical -fnoninteractive'],
249 if $::hostname == handel {
250 include puppetmaster::db
251 $dbpassword = $puppetmaster::db::password
253 file { '/etc/puppet/puppet.conf':
254 content => template('debian-org/puppet.conf.erb'),
256 file { '/etc/default/puppet':
257 source => 'puppet:///modules/debian-org/puppet.default',
259 file { '/etc/systemd':
263 file { '/etc/systemd/system':
267 file { '/etc/systemd/system/ud-replicated.service':
268 ensure => $servicefiles,
269 source => 'puppet:///modules/debian-org/ud-replicated.service',
270 notify => Exec['systemctl daemon-reload'],
273 file { '/etc/systemd/system/multi-user.target.wants/ud-replicated.service':
275 target => '../ud-replicated.service',
276 notify => Exec['systemctl daemon-reload'],
279 file { '/etc/systemd/system/puppet.service':
281 target => '/dev/null',
282 notify => Exec['systemctl daemon-reload'],
285 file { '/etc/cron.d/dsa-puppet-stuff':
286 content => template('debian-org/dsa-puppet-stuff.cron.erb'),
287 require => Package['debian.org'],
289 file { '/etc/ldap/ldap.conf':
290 require => Package['debian.org'],
291 content => template('debian-org/ldap.conf.erb'),
293 file { '/etc/pam.d/common-session':
294 require => Package['debian.org'],
295 content => template('debian-org/pam.common-session.erb'),
297 file { '/etc/pam.d/common-session-noninteractive':
298 require => Package['debian.org'],
299 content => template('debian-org/pam.common-session-noninteractive.erb'),
301 file { '/etc/rc.local':
303 content => template('debian-org/rc.local.erb'),
304 notify => Exec['service rc.local start'],
310 file { '/etc/dsa/cron.ignore.dsa-puppet-stuff':
311 source => 'puppet:///modules/debian-org/dsa-puppet-stuff.cron.ignore',
312 require => Package['debian.org']
314 file { '/etc/nsswitch.conf':
316 source => 'puppet:///modules/debian-org/nsswitch.conf',
319 # set mmap_min_addr to 4096 to mitigate
320 # Linux NULL-pointer dereference exploits
321 site::sysctl { 'mmap_min_addr':
324 site::sysctl { 'perf_event_paranoid':
325 key => 'kernel.perf_event_paranoid',
328 site::alternative { 'editor':
329 linkto => '/usr/bin/vim.basic',
331 site::alternative { 'view':
332 linkto => '/usr/bin/vim.basic',
334 mailalias { 'samhain-reports':
336 recipient => $debianadmin,
337 require => Package['debian.org']
340 file { '/usr/local/bin/check_for_updates':
341 source => 'puppet:///modules/debian-org/check_for_updates',
347 exec { 'apt-get update':
348 path => '/usr/bin:/usr/sbin:/bin:/sbin',
349 onlyif => '/usr/local/bin/check_for_updates',
350 require => File['/usr/local/bin/check_for_updates']
352 Exec['apt-get update']->Package<| tag == extra_repo |>
354 exec { 'dpkg-reconfigure tzdata -pcritical -fnoninteractive':
355 path => '/usr/bin:/usr/sbin:/bin:/sbin',
358 exec { 'service puppetmaster restart':
361 exec { 'service rc.local start':
368 exec { 'systemctl daemon-reload':
370 onlyif => "test -x /bin/systemctl"
373 tidy { '/var/lib/puppet/clientbucket/':
377 matches => [ 'paths', 'contents' ],
381 file { '/root/.bashrc':
382 source => 'puppet:///modules/debian-org/root-dotfiles/bashrc',
384 file { '/root/.profile':
385 source => 'puppet:///modules/debian-org/root-dotfiles/profile',
387 file { '/root/.screenrc':
388 source => 'puppet:///modules/debian-org/root-dotfiles/screenrc',
390 file { '/root/.vimrc':
391 source => 'puppet:///modules/debian-org/root-dotfiles/vimrc',