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',
56 file { '/etc/ssh/ssh_known_hosts':
60 source => 'puppet:///modules/debian-org/basic-ssh_known_hosts'
63 if ($::lsbmajdistrelease >= 8) {
64 $rubyfs_package = 'ruby-filesystem'
66 $rubyfs_package = 'libfilesystem-ruby1.9'
102 if getfromhash($site::nodeinfo, 'broken-rtc') {
103 package { 'fake-hwclock':
109 package { 'molly-guard':
112 file { '/etc/molly-guard/run.d/10-check-kvm':
114 source => 'puppet:///modules/debian-org/molly-guard/10-check-kvm',
115 require => Package['molly-guard'],
117 file { '/etc/molly-guard/run.d/15-acquire-reboot-lock':
119 source => 'puppet:///modules/debian-org/molly-guard/15-acquire-reboot-lock',
120 require => Package['molly-guard'],
123 file { '/etc/apt/trusted-keys.d':
128 file { '/etc/apt/trusted.gpg':
133 if ($::lsbmajdistrelease >= 8) {
134 site::aptrepo { 'security':
135 url => 'http://security-cdn.debian.org/',
136 suite => "${mungedcodename}/updates",
137 components => ['main','contrib','non-free']
140 site::aptrepo { 'security':
144 site::aptrepo { 'debian-lts':
148 site::aptrepo { 'backports.debian.org':
150 suite => "${::lsbdistcodename}-backports",
151 components => ['main','contrib','non-free']
154 site::aptrepo { 'volatile':
156 suite => "${::lsbdistcodename}-updates",
157 components => ['main','contrib','non-free']
160 if ($::hostname in [] or $::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) {
161 site::aptrepo { 'proposed-updates':
163 suite => "${mungedcodename}-proposed-updates",
164 components => ['main','contrib','non-free']
167 site::aptrepo { 'proposed-updates':
172 site::aptrepo { 'debian.org':
176 site::aptrepo { 'db.debian.org':
177 url => 'http://db.debian.org/debian-admin',
178 suite => 'debian-all',
179 components => 'main',
180 key => 'puppet:///modules/debian-org/db.debian.org.gpg',
182 site::aptrepo { 'db.debian.org-suite':
183 url => 'http://db.debian.org/debian-admin',
184 suite => $::lsbdistcodename,
185 components => 'main',
188 augeas { 'inittab_replicate':
189 context => '/files/etc/inittab',
191 'set ud/runlevels 2345',
192 'set ud/action respawn',
193 'set ud/process "/usr/bin/ud-replicated -d"',
195 notify => Exec['init q'],
198 if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') {
199 site::aptrepo { 'debian':
200 url => getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'),
201 suite => $mungedcodename,
202 components => ['main','contrib','non-free']
205 site::aptrepo { 'debian-cdn':
209 site::aptrepo { 'debian2':
210 url => "http://cdn-fastly.deb.debian.org/debian",
211 suite => $mungedcodename,
212 components => ['main','contrib','non-free']
215 file { '/etc/facter':
220 source => 'puppet:///files/empty/',
222 file { '/etc/facter/facts.d':
225 file { '/etc/facter/facts.d/debian_facts.yaml':
226 content => template('debian-org/debian_facts.yaml.erb')
228 file { '/etc/apt/preferences':
229 source => 'puppet:///modules/debian-org/apt.preferences',
231 file { '/etc/apt/apt.conf.d/local-compression':
232 source => 'puppet:///modules/debian-org/apt.conf.d/local-compression',
234 file { '/etc/apt/apt.conf.d/local-recommends':
235 source => 'puppet:///modules/debian-org/apt.conf.d/local-recommends',
237 file { '/etc/apt/apt.conf.d/local-pdiffs':
238 source => 'puppet:///modules/debian-org/apt.conf.d/local-pdiffs',
240 file { '/etc/apt/apt.conf.d/local-langs':
241 source => 'puppet:///modules/debian-org/apt.conf.d/local-langs',
243 file { '/etc/timezone':
244 source => 'puppet:///modules/debian-org/timezone',
245 notify => Exec['dpkg-reconfigure tzdata -pcritical -fnoninteractive'],
247 if $::hostname == handel {
248 include puppetmaster::db
249 $dbpassword = $puppetmaster::db::password
251 file { '/etc/puppet/puppet.conf':
252 content => template('debian-org/puppet.conf.erb'),
254 file { '/etc/default/puppet':
255 source => 'puppet:///modules/debian-org/puppet.default',
257 file { '/etc/systemd':
261 file { '/etc/systemd/system':
265 file { '/etc/systemd/system/ud-replicated.service':
266 ensure => $servicefiles,
267 source => 'puppet:///modules/debian-org/ud-replicated.service',
268 notify => Exec['systemctl daemon-reload'],
271 file { '/etc/systemd/system/multi-user.target.wants/ud-replicated.service':
273 target => '../ud-replicated.service',
274 notify => Exec['systemctl daemon-reload'],
277 file { '/etc/systemd/system/puppet.service':
279 target => '/dev/null',
280 notify => Exec['systemctl daemon-reload'],
283 file { '/etc/cron.d/dsa-puppet-stuff':
284 content => template('debian-org/dsa-puppet-stuff.cron.erb'),
285 require => Package['debian.org'],
287 file { '/etc/ldap/ldap.conf':
288 require => Package['debian.org'],
289 content => template('debian-org/ldap.conf.erb'),
291 file { '/etc/pam.d/common-session':
292 require => Package['debian.org'],
293 content => template('debian-org/pam.common-session.erb'),
295 file { '/etc/pam.d/common-session-noninteractive':
296 require => Package['debian.org'],
297 content => template('debian-org/pam.common-session-noninteractive.erb'),
299 file { '/etc/rc.local':
301 content => template('debian-org/rc.local.erb'),
302 notify => Exec['service rc.local start'],
308 file { '/etc/dsa/cron.ignore.dsa-puppet-stuff':
309 source => 'puppet:///modules/debian-org/dsa-puppet-stuff.cron.ignore',
310 require => Package['debian.org']
312 file { '/etc/nsswitch.conf':
314 source => 'puppet:///modules/debian-org/nsswitch.conf',
317 file { '/etc/profile.d/timeout.sh':
319 source => 'puppet:///modules/debian-org/etc.profile.d/timeout.sh',
324 file { '/etc/zsh/zprofile':
326 source => 'puppet:///modules/debian-org/etc.zsh/zprofile',
329 # set mmap_min_addr to 4096 to mitigate
330 # Linux NULL-pointer dereference exploits
331 site::sysctl { 'mmap_min_addr':
334 site::sysctl { 'perf_event_paranoid':
335 key => 'kernel.perf_event_paranoid',
338 site::alternative { 'editor':
339 linkto => '/usr/bin/vim.basic',
341 site::alternative { 'view':
342 linkto => '/usr/bin/vim.basic',
344 mailalias { 'samhain-reports':
346 recipient => $debianadmin,
347 require => Package['debian.org']
350 file { '/usr/local/bin/check_for_updates':
351 source => 'puppet:///modules/debian-org/check_for_updates',
357 exec { 'apt-get update':
358 path => '/usr/bin:/usr/sbin:/bin:/sbin',
359 onlyif => '/usr/local/bin/check_for_updates',
360 require => File['/usr/local/bin/check_for_updates']
362 Exec['apt-get update']->Package<| tag == extra_repo |>
364 exec { 'dpkg-reconfigure tzdata -pcritical -fnoninteractive':
365 path => '/usr/bin:/usr/sbin:/bin:/sbin',
368 exec { 'service puppetmaster restart':
371 exec { 'service rc.local start':
378 exec { 'systemctl daemon-reload':
380 onlyif => "test -x /bin/systemctl"
383 exec { 'systemd-tmpfiles --create --exclude-prefix=/dev':
385 onlyif => "test -x /bin/systemd-tmpfiles"
388 tidy { '/var/lib/puppet/clientbucket/':
392 matches => [ 'paths', 'contents' ],
396 file { '/root/.bashrc':
397 source => 'puppet:///modules/debian-org/root-dotfiles/bashrc',
399 file { '/root/.profile':
400 source => 'puppet:///modules/debian-org/root-dotfiles/profile',
402 file { '/root/.screenrc':
403 source => 'puppet:///modules/debian-org/root-dotfiles/screenrc',
405 file { '/root/.vimrc':
406 source => 'puppet:///modules/debian-org/root-dotfiles/vimrc',