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 [ball, corelli, eysler, lucatelli, mayer, mayr, pettersson]) or
166 # ($::hoster and ($::hoster in [bytemark, man-da, brown])) {
167 # site::aptrepo { 'proposed-updates':
169 # suite => "${::lsbdistcodename}-proposed-updates",
170 # components => ['main','contrib','non-free']
173 site::aptrepo { 'proposed-updates':
178 site::aptrepo { 'debian.org':
182 site::aptrepo { 'db.debian.org':
183 url => 'http://db.debian.org/debian-admin',
184 suite => 'debian-all',
185 components => 'main',
186 key => 'puppet:///modules/debian-org/db.debian.org.gpg',
188 site::aptrepo { 'db.debian.org-suite':
189 url => 'http://db.debian.org/debian-admin',
190 suite => $::lsbdistcodename,
191 components => 'main',
194 augeas { 'inittab_replicate':
195 context => '/files/etc/inittab',
197 'set ud/runlevels 2345',
198 'set ud/action respawn',
199 'set ud/process "/usr/bin/ud-replicated -d"',
201 notify => Exec['init q'],
204 if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') {
205 site::aptrepo { 'debian':
206 url => getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'),
207 suite => $mungedcodename,
208 components => ['main','contrib','non-free']
212 file { '/etc/facter':
217 source => 'puppet:///files/empty/',
219 file { '/etc/facter/facts.d':
222 file { '/etc/facter/facts.d/debian_facts.yaml':
223 content => template('debian-org/debian_facts.yaml.erb')
225 file { '/etc/apt/preferences':
226 source => 'puppet:///modules/debian-org/apt.preferences',
228 file { '/etc/apt/apt.conf.d/local-compression':
229 source => 'puppet:///modules/debian-org/apt.conf.d/local-compression',
231 file { '/etc/apt/apt.conf.d/local-recommends':
232 source => 'puppet:///modules/debian-org/apt.conf.d/local-recommends',
234 file { '/etc/apt/apt.conf.d/local-pdiffs':
235 source => 'puppet:///modules/debian-org/apt.conf.d/local-pdiffs',
237 file { '/etc/timezone':
238 source => 'puppet:///modules/debian-org/timezone',
239 notify => Exec['dpkg-reconfigure tzdata -pcritical -fnoninteractive'],
241 if $::hostname == handel {
242 include puppetmaster::db
243 $dbpassword = $puppetmaster::db::password
245 file { '/etc/puppet/puppet.conf':
246 content => template('debian-org/puppet.conf.erb'),
248 file { '/etc/default/puppet':
249 source => 'puppet:///modules/debian-org/puppet.default',
251 file { '/etc/systemd':
255 file { '/etc/systemd/system':
259 file { '/etc/systemd/system/ud-replicated.service':
260 ensure => $servicefiles,
261 source => 'puppet:///modules/debian-org/ud-replicated.service',
262 notify => Exec['systemctl daemon-reload'],
265 file { '/etc/systemd/system/multi-user.target.wants/ud-replicated.service':
267 target => '../ud-replicated.service',
268 notify => Exec['systemctl daemon-reload'],
271 file { '/etc/systemd/system/puppet.service':
273 target => '/dev/null',
274 notify => Exec['systemctl daemon-reload'],
277 file { '/etc/cron.d/dsa-puppet-stuff':
278 content => template('debian-org/dsa-puppet-stuff.cron.erb'),
279 require => Package['debian.org'],
281 file { '/etc/ldap/ldap.conf':
282 require => Package['debian.org'],
283 content => template('debian-org/ldap.conf.erb'),
285 file { '/etc/pam.d/common-session':
286 require => Package['debian.org'],
287 content => template('debian-org/pam.common-session.erb'),
289 file { '/etc/pam.d/common-session-noninteractive':
290 require => Package['debian.org'],
291 content => template('debian-org/pam.common-session-noninteractive.erb'),
293 file { '/etc/rc.local':
295 content => template('debian-org/rc.local.erb'),
296 notify => Exec['service rc.local start'],
302 file { '/etc/dsa/cron.ignore.dsa-puppet-stuff':
303 source => 'puppet:///modules/debian-org/dsa-puppet-stuff.cron.ignore',
304 require => Package['debian.org']
306 file { '/etc/nsswitch.conf':
308 source => 'puppet:///modules/debian-org/nsswitch.conf',
311 # set mmap_min_addr to 4096 to mitigate
312 # Linux NULL-pointer dereference exploits
313 site::sysctl { 'mmap_min_addr':
316 site::sysctl { 'perf_event_paranoid':
317 key => 'kernel.perf_event_paranoid',
320 site::alternative { 'editor':
321 linkto => '/usr/bin/vim.basic',
323 site::alternative { 'view':
324 linkto => '/usr/bin/vim.basic',
326 mailalias { 'samhain-reports':
328 recipient => $debianadmin,
329 require => Package['debian.org']
332 file { '/usr/local/bin/check_for_updates':
333 source => 'puppet:///modules/debian-org/check_for_updates',
339 exec { 'apt-get update':
340 path => '/usr/bin:/usr/sbin:/bin:/sbin',
341 onlyif => '/usr/local/bin/check_for_updates',
342 require => File['/usr/local/bin/check_for_updates']
344 Exec['apt-get update']->Package<| tag == extra_repo |>
346 exec { 'dpkg-reconfigure tzdata -pcritical -fnoninteractive':
347 path => '/usr/bin:/usr/sbin:/bin:/sbin',
350 exec { 'service puppetmaster restart':
353 exec { 'service rc.local start':
360 exec { 'systemctl daemon-reload':
362 onlyif => "test -x /bin/systemctl"
365 exec { 'systemd-tmpfiles --create --exclude-prefix=/dev':
367 onlyif => "test -x /bin/systemd-tmpfiles"
370 tidy { '/var/lib/puppet/clientbucket/':
374 matches => [ 'paths', 'contents' ],
378 file { '/root/.bashrc':
379 source => 'puppet:///modules/debian-org/root-dotfiles/bashrc',
381 file { '/root/.profile':
382 source => 'puppet:///modules/debian-org/root-dotfiles/profile',
384 file { '/root/.screenrc':
385 source => 'puppet:///modules/debian-org/root-dotfiles/screenrc',
387 file { '/root/.vimrc':
388 source => 'puppet:///modules/debian-org/root-dotfiles/vimrc',