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 site::aptrepo { 'security':
135 url => 'http://security-cdn.debian.org/',
136 suite => "${mungedcodename}/updates",
137 components => ['main','contrib','non-free']
139 site::aptrepo { 'debian-lts':
143 site::aptrepo { 'backports.debian.org':
145 suite => "${::lsbdistcodename}-backports",
146 components => ['main','contrib','non-free']
149 site::aptrepo { 'volatile':
151 suite => "${::lsbdistcodename}-updates",
152 components => ['main','contrib','non-free']
155 if ($::hostname in [] or $::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) {
156 site::aptrepo { 'proposed-updates':
158 suite => "${mungedcodename}-proposed-updates",
159 components => ['main','contrib','non-free']
162 site::aptrepo { 'proposed-updates':
167 site::aptrepo { 'debian.org':
171 site::aptrepo { 'db.debian.org':
172 url => 'http://db.debian.org/debian-admin',
173 suite => 'debian-all',
174 components => 'main',
175 key => 'puppet:///modules/debian-org/db.debian.org.gpg',
177 site::aptrepo { 'db.debian.org-suite':
178 url => 'http://db.debian.org/debian-admin',
179 suite => $::lsbdistcodename,
180 components => 'main',
183 augeas { 'inittab_replicate':
184 context => '/files/etc/inittab',
186 'set ud/runlevels 2345',
187 'set ud/action respawn',
188 'set ud/process "/usr/bin/ud-replicated -d"',
190 notify => Exec['init q'],
193 if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') {
194 site::aptrepo { 'debian':
195 url => getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'),
196 suite => $mungedcodename,
197 components => ['main','contrib','non-free']
201 file { '/etc/facter':
206 source => 'puppet:///files/empty/',
208 file { '/etc/facter/facts.d':
211 file { '/etc/facter/facts.d/debian_facts.yaml':
212 content => template('debian-org/debian_facts.yaml.erb')
214 file { '/etc/apt/preferences':
215 source => 'puppet:///modules/debian-org/apt.preferences',
217 file { '/etc/apt/apt.conf.d/local-compression':
218 source => 'puppet:///modules/debian-org/apt.conf.d/local-compression',
220 file { '/etc/apt/apt.conf.d/local-recommends':
221 source => 'puppet:///modules/debian-org/apt.conf.d/local-recommends',
223 file { '/etc/apt/apt.conf.d/local-pdiffs':
224 source => 'puppet:///modules/debian-org/apt.conf.d/local-pdiffs',
226 file { '/etc/timezone':
227 source => 'puppet:///modules/debian-org/timezone',
228 notify => Exec['dpkg-reconfigure tzdata -pcritical -fnoninteractive'],
230 if $::hostname == handel {
231 include puppetmaster::db
232 $dbpassword = $puppetmaster::db::password
234 file { '/etc/puppet/puppet.conf':
235 content => template('debian-org/puppet.conf.erb'),
237 file { '/etc/default/puppet':
238 source => 'puppet:///modules/debian-org/puppet.default',
240 file { '/etc/systemd':
244 file { '/etc/systemd/system':
248 file { '/etc/systemd/system/ud-replicated.service':
249 ensure => $servicefiles,
250 source => 'puppet:///modules/debian-org/ud-replicated.service',
251 notify => Exec['systemctl daemon-reload'],
254 file { '/etc/systemd/system/multi-user.target.wants/ud-replicated.service':
256 target => '../ud-replicated.service',
257 notify => Exec['systemctl daemon-reload'],
260 file { '/etc/systemd/system/puppet.service':
262 target => '/dev/null',
263 notify => Exec['systemctl daemon-reload'],
266 file { '/etc/cron.d/dsa-puppet-stuff':
267 content => template('debian-org/dsa-puppet-stuff.cron.erb'),
268 require => Package['debian.org'],
270 file { '/etc/ldap/ldap.conf':
271 require => Package['debian.org'],
272 content => template('debian-org/ldap.conf.erb'),
274 file { '/etc/pam.d/common-session':
275 require => Package['debian.org'],
276 content => template('debian-org/pam.common-session.erb'),
278 file { '/etc/pam.d/common-session-noninteractive':
279 require => Package['debian.org'],
280 content => template('debian-org/pam.common-session-noninteractive.erb'),
282 file { '/etc/rc.local':
284 content => template('debian-org/rc.local.erb'),
285 notify => Exec['service rc.local start'],
291 file { '/etc/dsa/cron.ignore.dsa-puppet-stuff':
292 source => 'puppet:///modules/debian-org/dsa-puppet-stuff.cron.ignore',
293 require => Package['debian.org']
295 file { '/etc/nsswitch.conf':
297 source => 'puppet:///modules/debian-org/nsswitch.conf',
300 # set mmap_min_addr to 4096 to mitigate
301 # Linux NULL-pointer dereference exploits
302 site::sysctl { 'mmap_min_addr':
305 site::sysctl { 'perf_event_paranoid':
306 key => 'kernel.perf_event_paranoid',
309 site::alternative { 'editor':
310 linkto => '/usr/bin/vim.basic',
312 site::alternative { 'view':
313 linkto => '/usr/bin/vim.basic',
315 mailalias { 'samhain-reports':
317 recipient => $debianadmin,
318 require => Package['debian.org']
321 file { '/usr/local/bin/check_for_updates':
322 source => 'puppet:///modules/debian-org/check_for_updates',
328 exec { 'apt-get update':
329 path => '/usr/bin:/usr/sbin:/bin:/sbin',
330 onlyif => '/usr/local/bin/check_for_updates',
331 require => File['/usr/local/bin/check_for_updates']
333 Exec['apt-get update']->Package<| tag == extra_repo |>
335 exec { 'dpkg-reconfigure tzdata -pcritical -fnoninteractive':
336 path => '/usr/bin:/usr/sbin:/bin:/sbin',
339 exec { 'service puppetmaster restart':
342 exec { 'service rc.local start':
349 exec { 'systemctl daemon-reload':
351 onlyif => "test -x /bin/systemctl"
354 exec { 'systemd-tmpfiles --create --exclude-prefix=/dev':
356 onlyif => "test -x /bin/systemd-tmpfiles"
359 tidy { '/var/lib/puppet/clientbucket/':
363 matches => [ 'paths', 'contents' ],
367 file { '/root/.bashrc':
368 source => 'puppet:///modules/debian-org/root-dotfiles/bashrc',
370 file { '/root/.profile':
371 source => 'puppet:///modules/debian-org/root-dotfiles/profile',
373 file { '/root/.screenrc':
374 source => 'puppet:///modules/debian-org/root-dotfiles/screenrc',
376 file { '/root/.vimrc':
377 source => 'puppet:///modules/debian-org/root-dotfiles/vimrc',