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/'
16 if $::lsbmajdistrelease < 7 {
17 $mirror_backports = 'http://backports.debian.org/debian-backports/'
19 $mirror_backports = $mirror
22 if $::lsbmajdistrelease <= 7 {
23 $mungedcodename = $::lsbdistcodename
24 } elsif ($::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) {
25 $mungedcodename = "${::lsbdistcodename}-kfreebsd"
27 $mungedcodename = $::lsbdistcodename
32 $servicefiles = 'present'
34 $servicefiles = 'absent'
38 'debian-archive-debian-samhain-reports@master.debian.org',
39 'debian-admin@ftbfs.de',
42 'paravoid@debian.org',
62 file { '/etc/ssh/ssh_known_hosts':
66 source => 'puppet:///modules/debian-org/basic-ssh_known_hosts'
69 if ($::lsbmajdistrelease >= 8) {
70 $rubyfs_package = 'ruby-filesystem'
71 } elsif $::lsbmajdistrelease == 7 {
72 $rubyfs_package = 'libfilesystem-ruby1.9'
74 $rubyfs_package = 'libfilesystem-ruby1.8'
110 if getfromhash($site::nodeinfo, 'broken-rtc') {
111 package { 'fake-hwclock':
117 package { 'molly-guard':
120 file { '/etc/molly-guard/run.d/10-check-kvm':
122 source => 'puppet:///modules/debian-org/molly-guard/10-check-kvm',
123 require => Package['molly-guard'],
125 file { '/etc/molly-guard/run.d/15-acquire-reboot-lock':
127 source => 'puppet:///modules/debian-org/molly-guard/15-acquire-reboot-lock',
128 require => Package['molly-guard'],
131 file { '/etc/apt/trusted-keys.d':
136 file { '/etc/apt/trusted.gpg':
141 site::aptrepo { 'security':
142 url => 'http://security-cdn.debian.org/',
143 suite => "${mungedcodename}/updates",
144 components => ['main','contrib','non-free']
146 if $::lsbmajdistrelease < 7 {
147 site::aptrepo { 'debian-lts':
149 suite => "${::lsbdistcodename}-lts",
150 components => ['main','contrib','non-free']
153 site::aptrepo { 'debian-lts':
158 site::aptrepo { 'backports.debian.org':
159 url => $mirror_backports,
160 suite => "${::lsbdistcodename}-backports",
161 components => ['main','contrib','non-free']
164 site::aptrepo { 'volatile':
166 suite => "${::lsbdistcodename}-updates",
167 components => ['main','contrib','non-free']
170 if ($::hostname in []) {
171 site::aptrepo { 'proposed-updates':
173 suite => "${::lsbdistcodename}-proposed-updates",
174 components => ['main','contrib','non-free']
177 site::aptrepo { 'proposed-updates':
182 site::aptrepo { 'debian.org':
186 site::aptrepo { 'db.debian.org':
187 url => 'http://db.debian.org/debian-admin',
188 suite => 'debian-all',
189 components => 'main',
190 key => 'puppet:///modules/debian-org/db.debian.org.gpg',
192 site::aptrepo { 'db.debian.org-suite':
193 url => 'http://db.debian.org/debian-admin',
194 suite => $::lsbdistcodename,
195 components => 'main',
198 augeas { 'inittab_replicate':
199 context => '/files/etc/inittab',
201 'set ud/runlevels 2345',
202 'set ud/action respawn',
203 'set ud/process "/usr/bin/ud-replicated -d"',
205 notify => Exec['init q'],
208 if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') {
209 site::aptrepo { 'debian':
210 url => getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'),
211 suite => $mungedcodename,
212 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',