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'
66 } elsif $::lsbmajdistrelease == 7 {
67 $rubyfs_package = 'libfilesystem-ruby1.9'
69 $rubyfs_package = 'libfilesystem-ruby1.8'
105 if getfromhash($site::nodeinfo, 'broken-rtc') {
106 package { 'fake-hwclock':
112 package { 'molly-guard':
115 file { '/etc/molly-guard/run.d/10-check-kvm':
117 source => 'puppet:///modules/debian-org/molly-guard/10-check-kvm',
118 require => Package['molly-guard'],
120 file { '/etc/molly-guard/run.d/15-acquire-reboot-lock':
122 source => 'puppet:///modules/debian-org/molly-guard/15-acquire-reboot-lock',
123 require => Package['molly-guard'],
126 file { '/etc/apt/trusted-keys.d':
131 file { '/etc/apt/trusted.gpg':
136 site::aptrepo { 'security':
137 url => 'http://security.debian.org/',
138 suite => "${mungedcodename}/updates",
139 components => ['main','contrib','non-free']
141 if $::lsbmajdistrelease < 7 {
142 site::aptrepo { 'debian-lts':
144 suite => "${::lsbdistcodename}-lts",
145 components => ['main','contrib','non-free']
148 site::aptrepo { 'debian-lts':
153 site::aptrepo { 'backports.debian.org':
154 url => $mirror_backports,
155 suite => "${::lsbdistcodename}-backports",
156 components => ['main','contrib','non-free']
159 site::aptrepo { 'volatile':
161 suite => "${::lsbdistcodename}-updates",
162 components => ['main','contrib','non-free']
165 if ($::hostname in [mips-aql-05, mipsel-aql-02]) {
166 site::aptrepo { 'proposed-updates':
168 suite => "${::lsbdistcodename}-proposed-updates",
169 components => ['main','contrib','non-free']
172 site::aptrepo { 'proposed-updates':
177 site::aptrepo { 'debian.org':
181 site::aptrepo { 'db.debian.org':
182 url => 'http://db.debian.org/debian-admin',
183 suite => 'debian-all',
184 components => 'main',
185 key => 'puppet:///modules/debian-org/db.debian.org.gpg',
187 site::aptrepo { 'db.debian.org-suite':
188 url => 'http://db.debian.org/debian-admin',
189 suite => $::lsbdistcodename,
190 components => 'main',
193 augeas { 'inittab_replicate':
194 context => '/files/etc/inittab',
196 'set ud/runlevels 2345',
197 'set ud/action respawn',
198 'set ud/process "/usr/bin/ud-replicated -d"',
200 notify => Exec['init q'],
203 if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') {
204 site::aptrepo { 'debian':
205 url => getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'),
206 suite => $mungedcodename,
207 components => ['main','contrib','non-free']
211 file { '/etc/facter':
216 source => 'puppet:///files/empty/',
218 file { '/etc/facter/facts.d':
221 file { '/etc/facter/facts.d/debian_facts.yaml':
222 content => template('debian-org/debian_facts.yaml.erb')
224 file { '/etc/apt/preferences':
225 source => 'puppet:///modules/debian-org/apt.preferences',
227 file { '/etc/apt/apt.conf.d/local-compression':
228 source => 'puppet:///modules/debian-org/apt.conf.d/local-compression',
230 file { '/etc/apt/apt.conf.d/local-recommends':
231 source => 'puppet:///modules/debian-org/apt.conf.d/local-recommends',
233 file { '/etc/apt/apt.conf.d/local-pdiffs':
234 source => 'puppet:///modules/debian-org/apt.conf.d/local-pdiffs',
236 file { '/etc/timezone':
237 source => 'puppet:///modules/debian-org/timezone',
238 notify => Exec['dpkg-reconfigure tzdata -pcritical -fnoninteractive'],
240 if $::hostname == handel {
241 include puppetmaster::db
242 $dbpassword = $puppetmaster::db::password
244 file { '/etc/puppet/puppet.conf':
245 content => template('debian-org/puppet.conf.erb'),
247 file { '/etc/default/puppet':
248 source => 'puppet:///modules/debian-org/puppet.default',
250 file { '/etc/systemd':
254 file { '/etc/systemd/system':
258 file { '/etc/systemd/system/ud-replicated.service':
259 ensure => $servicefiles,
260 source => 'puppet:///modules/debian-org/ud-replicated.service',
261 notify => Exec['systemctl daemon-reload'],
264 file { '/etc/systemd/system/multi-user.target.wants/ud-replicated.service':
266 target => '../ud-replicated.service',
267 notify => Exec['systemctl daemon-reload'],
270 file { '/etc/systemd/system/puppet.service':
272 target => '/dev/null',
273 notify => Exec['systemctl daemon-reload'],
276 file { '/etc/cron.d/dsa-puppet-stuff':
277 content => template('debian-org/dsa-puppet-stuff.cron.erb'),
278 require => Package['debian.org'],
280 file { '/etc/ldap/ldap.conf':
281 require => Package['debian.org'],
282 content => template('debian-org/ldap.conf.erb'),
284 file { '/etc/pam.d/common-session':
285 require => Package['debian.org'],
286 content => template('debian-org/pam.common-session.erb'),
288 file { '/etc/pam.d/common-session-noninteractive':
289 require => Package['debian.org'],
290 content => template('debian-org/pam.common-session-noninteractive.erb'),
292 file { '/etc/rc.local':
294 content => template('debian-org/rc.local.erb'),
295 notify => Exec['service rc.local start'],
301 file { '/etc/dsa/cron.ignore.dsa-puppet-stuff':
302 source => 'puppet:///modules/debian-org/dsa-puppet-stuff.cron.ignore',
303 require => Package['debian.org']
305 file { '/etc/nsswitch.conf':
307 source => 'puppet:///modules/debian-org/nsswitch.conf',
310 # set mmap_min_addr to 4096 to mitigate
311 # Linux NULL-pointer dereference exploits
312 site::sysctl { 'mmap_min_addr':
315 site::sysctl { 'perf_event_paranoid':
316 key => 'kernel.perf_event_paranoid',
319 site::alternative { 'editor':
320 linkto => '/usr/bin/vim.basic',
322 site::alternative { 'view':
323 linkto => '/usr/bin/vim.basic',
325 mailalias { 'samhain-reports':
327 recipient => $debianadmin,
328 require => Package['debian.org']
331 file { '/usr/local/bin/check_for_updates':
332 source => 'puppet:///modules/debian-org/check_for_updates',
338 exec { 'apt-get update':
339 path => '/usr/bin:/usr/sbin:/bin:/sbin',
340 onlyif => '/usr/local/bin/check_for_updates',
341 require => File['/usr/local/bin/check_for_updates']
343 Exec['apt-get update']->Package<| tag == extra_repo |>
345 exec { 'dpkg-reconfigure tzdata -pcritical -fnoninteractive':
346 path => '/usr/bin:/usr/sbin:/bin:/sbin',
349 exec { 'service puppetmaster restart':
352 exec { 'service rc.local start':
359 exec { 'systemctl daemon-reload':
361 onlyif => "test -x /bin/systemctl"
364 exec { 'systemd-tmpfiles --create --exclude-prefix=/dev':
366 onlyif => "test -x /bin/systemd-tmpfiles"
369 tidy { '/var/lib/puppet/clientbucket/':
373 matches => [ 'paths', 'contents' ],
377 file { '/root/.bashrc':
378 source => 'puppet:///modules/debian-org/root-dotfiles/bashrc',
380 file { '/root/.profile':
381 source => 'puppet:///modules/debian-org/root-dotfiles/profile',
383 file { '/root/.screenrc':
384 source => 'puppet:///modules/debian-org/root-dotfiles/screenrc',
386 file { '/root/.vimrc':
387 source => 'puppet:///modules/debian-org/root-dotfiles/vimrc',