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/'
10 if $::lsbmajdistrelease <= 8 {
11 $mirror = 'http://cdn-fastly.deb.debian.org/debian/'
13 $mirror = 'http://deb.debian.org/debian/'
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.9'
103 if getfromhash($site::nodeinfo, 'broken-rtc') {
104 package { 'fake-hwclock':
110 package { 'molly-guard':
113 file { '/etc/molly-guard/run.d/10-check-kvm':
115 source => 'puppet:///modules/debian-org/molly-guard/10-check-kvm',
116 require => Package['molly-guard'],
118 file { '/etc/molly-guard/run.d/15-acquire-reboot-lock':
120 source => 'puppet:///modules/debian-org/molly-guard/15-acquire-reboot-lock',
121 require => Package['molly-guard'],
124 file { '/etc/apt/trusted-keys.d':
129 file { '/etc/apt/trusted.gpg':
134 if ($::lsbmajdistrelease >= 8) {
135 site::aptrepo { 'security':
136 url => 'http://security-cdn.debian.org/',
137 suite => "${mungedcodename}/updates",
138 components => ['main','contrib','non-free']
141 site::aptrepo { 'security':
145 site::aptrepo { 'debian-lts':
149 site::aptrepo { 'backports.debian.org':
151 suite => "${::lsbdistcodename}-backports",
152 components => ['main','contrib','non-free']
155 site::aptrepo { 'volatile':
157 suite => "${::lsbdistcodename}-updates",
158 components => ['main','contrib','non-free']
161 if ($::hostname in [] or $::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) {
162 site::aptrepo { 'proposed-updates':
164 suite => "${mungedcodename}-proposed-updates",
165 components => ['main','contrib','non-free']
168 site::aptrepo { 'proposed-updates':
173 site::aptrepo { 'debian.org':
177 site::aptrepo { 'db.debian.org':
178 url => 'http://db.debian.org/debian-admin',
179 suite => 'debian-all',
180 components => 'main',
181 key => 'puppet:///modules/debian-org/db.debian.org.gpg',
183 site::aptrepo { 'db.debian.org-suite':
184 url => 'http://db.debian.org/debian-admin',
185 suite => $::lsbdistcodename,
186 components => 'main',
189 augeas { 'inittab_replicate':
190 context => '/files/etc/inittab',
192 'set ud/runlevels 2345',
193 'set ud/action respawn',
194 'set ud/process "/usr/bin/ud-replicated -d"',
196 notify => Exec['init q'],
199 if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') {
200 site::aptrepo { 'debian':
201 url => getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'),
202 suite => $mungedcodename,
203 components => ['main','contrib','non-free']
206 site::aptrepo { 'debian-cdn':
210 site::aptrepo { 'debian2':
211 url => "http://cdn-fastly.deb.debian.org/debian",
212 suite => $mungedcodename,
213 components => ['main','contrib','non-free']
216 file { '/etc/facter':
221 source => 'puppet:///files/empty/',
223 file { '/etc/facter/facts.d':
226 file { '/etc/facter/facts.d/debian_facts.yaml':
227 content => template('debian-org/debian_facts.yaml.erb')
229 file { '/etc/apt/preferences':
230 source => 'puppet:///modules/debian-org/apt.preferences',
232 file { '/etc/apt/apt.conf.d/local-compression':
233 source => 'puppet:///modules/debian-org/apt.conf.d/local-compression',
235 file { '/etc/apt/apt.conf.d/local-recommends':
236 source => 'puppet:///modules/debian-org/apt.conf.d/local-recommends',
238 file { '/etc/apt/apt.conf.d/local-pdiffs':
239 source => 'puppet:///modules/debian-org/apt.conf.d/local-pdiffs',
241 file { '/etc/timezone':
242 source => 'puppet:///modules/debian-org/timezone',
243 notify => Exec['dpkg-reconfigure tzdata -pcritical -fnoninteractive'],
245 if $::hostname == handel {
246 include puppetmaster::db
247 $dbpassword = $puppetmaster::db::password
249 file { '/etc/puppet/puppet.conf':
250 content => template('debian-org/puppet.conf.erb'),
252 file { '/etc/default/puppet':
253 source => 'puppet:///modules/debian-org/puppet.default',
255 file { '/etc/systemd':
259 file { '/etc/systemd/system':
263 file { '/etc/systemd/system/ud-replicated.service':
264 ensure => $servicefiles,
265 source => 'puppet:///modules/debian-org/ud-replicated.service',
266 notify => Exec['systemctl daemon-reload'],
269 file { '/etc/systemd/system/multi-user.target.wants/ud-replicated.service':
271 target => '../ud-replicated.service',
272 notify => Exec['systemctl daemon-reload'],
275 file { '/etc/systemd/system/puppet.service':
277 target => '/dev/null',
278 notify => Exec['systemctl daemon-reload'],
281 file { '/etc/cron.d/dsa-puppet-stuff':
282 content => template('debian-org/dsa-puppet-stuff.cron.erb'),
283 require => Package['debian.org'],
285 file { '/etc/ldap/ldap.conf':
286 require => Package['debian.org'],
287 content => template('debian-org/ldap.conf.erb'),
289 file { '/etc/pam.d/common-session':
290 require => Package['debian.org'],
291 content => template('debian-org/pam.common-session.erb'),
293 file { '/etc/pam.d/common-session-noninteractive':
294 require => Package['debian.org'],
295 content => template('debian-org/pam.common-session-noninteractive.erb'),
297 file { '/etc/rc.local':
299 content => template('debian-org/rc.local.erb'),
300 notify => Exec['service rc.local start'],
306 file { '/etc/dsa/cron.ignore.dsa-puppet-stuff':
307 source => 'puppet:///modules/debian-org/dsa-puppet-stuff.cron.ignore',
308 require => Package['debian.org']
310 file { '/etc/nsswitch.conf':
312 source => 'puppet:///modules/debian-org/nsswitch.conf',
315 # set mmap_min_addr to 4096 to mitigate
316 # Linux NULL-pointer dereference exploits
317 site::sysctl { 'mmap_min_addr':
320 site::sysctl { 'perf_event_paranoid':
321 key => 'kernel.perf_event_paranoid',
324 site::alternative { 'editor':
325 linkto => '/usr/bin/vim.basic',
327 site::alternative { 'view':
328 linkto => '/usr/bin/vim.basic',
330 mailalias { 'samhain-reports':
332 recipient => $debianadmin,
333 require => Package['debian.org']
336 file { '/usr/local/bin/check_for_updates':
337 source => 'puppet:///modules/debian-org/check_for_updates',
343 exec { 'apt-get update':
344 path => '/usr/bin:/usr/sbin:/bin:/sbin',
345 onlyif => '/usr/local/bin/check_for_updates',
346 require => File['/usr/local/bin/check_for_updates']
348 Exec['apt-get update']->Package<| tag == extra_repo |>
350 exec { 'dpkg-reconfigure tzdata -pcritical -fnoninteractive':
351 path => '/usr/bin:/usr/sbin:/bin:/sbin',
354 exec { 'service puppetmaster restart':
357 exec { 'service rc.local start':
364 exec { 'systemctl daemon-reload':
366 onlyif => "test -x /bin/systemctl"
369 exec { 'systemd-tmpfiles --create --exclude-prefix=/dev':
371 onlyif => "test -x /bin/systemd-tmpfiles"
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',