3 # Stuff common to all debian.org servers
6 include debian_org::apt
10 $servicefiles = 'present'
12 $servicefiles = 'absent'
15 # the virtual facter needs virt-what on jessie to work
16 if versioncmp($::lsbmajdistrelease, '9') < 0 {
17 package { 'virt-what': ensure => installed }
19 package { 'virt-what': ensure => purged }
22 $samhain_recipients = hiera('samhain_recipients')
23 $root_mail_alias = hiera('root_mail_alias')
37 'debian.org-recommended',
45 if versioncmp($::lsbmajdistrelease, '8') >= 0 {
46 $rubyfs_package = 'ruby-filesystem'
48 $rubyfs_package = 'libfilesystem-ruby1.9'
83 if getfromhash($site::nodeinfo, 'broken-rtc') {
84 package { 'fake-hwclock':
90 package { 'molly-guard':
93 file { '/etc/molly-guard/run.d/10-check-kvm':
95 source => 'puppet:///modules/debian_org/molly-guard/10-check-kvm',
96 require => Package['molly-guard'],
98 file { '/etc/molly-guard/run.d/15-acquire-reboot-lock':
100 source => 'puppet:///modules/debian_org/molly-guard/15-acquire-reboot-lock',
101 require => Package['molly-guard'],
104 augeas { 'inittab_replicate':
105 context => '/files/etc/inittab',
107 'set ud/runlevels 2345',
108 'set ud/action respawn',
109 'set ud/process "/usr/bin/ud-replicated -d"',
111 notify => Exec['init q'],
115 file { '/etc/facter':
120 source => 'puppet:///files/empty/',
122 file { '/etc/facter/facts.d':
125 file { '/etc/facter/facts.d/debian_facts.yaml':
126 content => template('debian_org/debian_facts.yaml.erb')
128 file { '/etc/timezone':
129 source => 'puppet:///modules/debian_org/timezone',
130 notify => Exec['dpkg-reconfigure tzdata -pcritical -fnoninteractive'],
132 if $::hostname == handel {
133 include puppetmaster::db
134 $dbpassword = $puppetmaster::db::password
136 file { '/etc/puppet/puppet.conf':
137 content => template('debian_org/puppet.conf.erb'),
141 file { '/etc/default/puppet':
142 source => 'puppet:///modules/debian_org/puppet.default',
144 file { '/etc/systemd':
148 file { '/etc/systemd/system':
152 file { '/etc/systemd/system/ud-replicated.service':
153 ensure => $servicefiles,
154 source => 'puppet:///modules/debian_org/ud-replicated.service',
155 notify => Exec['systemctl daemon-reload'],
158 file { '/etc/systemd/system/multi-user.target.wants/ud-replicated.service':
160 target => '../ud-replicated.service',
161 notify => Exec['systemctl daemon-reload'],
164 file { '/etc/systemd/system/puppet.service':
166 target => '/dev/null',
167 notify => Exec['systemctl daemon-reload'],
169 file { '/etc/systemd/system/proc-sys-fs-binfmt_misc.automount':
171 target => '/dev/null',
172 notify => Exec['systemctl daemon-reload'],
175 concat { '/etc/cron.d/dsa-puppet-stuff': }
176 concat::fragment { 'dsa-puppet-stuff---header':
177 target => '/etc/cron.d/dsa-puppet-stuff',
180 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
183 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/nagios/plugins
186 concat::fragment { 'dsa-puppet-stuff---all':
187 target => '/etc/cron.d/dsa-puppet-stuff',
189 content => template('debian_org/dsa-puppet-stuff.cron.erb'),
190 require => Package['debian.org'],
192 file { '/etc/ldap/ldap.conf':
193 require => Package['debian.org'],
194 content => template('debian_org/ldap.conf.erb'),
196 file { '/etc/pam.d/common-session':
197 require => Package['debian.org'],
198 content => template('debian_org/pam.common-session.erb'),
200 file { '/etc/pam.d/common-session-noninteractive':
201 require => Package['debian.org'],
202 content => template('debian_org/pam.common-session-noninteractive.erb'),
204 file { '/etc/rc.local':
206 content => template('debian_org/rc.local.erb'),
207 notify => Exec['service rc.local restart'],
213 file { '/etc/dsa/cron.ignore.dsa-puppet-stuff':
214 source => 'puppet:///modules/debian_org/dsa-puppet-stuff.cron.ignore',
215 require => Package['debian.org']
217 file { '/etc/nsswitch.conf':
219 source => 'puppet:///modules/debian_org/nsswitch.conf',
222 file { '/etc/profile.d/timeout.sh':
224 source => 'puppet:///modules/debian_org/etc.profile.d/timeout.sh',
229 file { '/etc/zsh/zprofile':
231 source => 'puppet:///modules/debian_org/etc.zsh/zprofile',
233 file { '/etc/environment':
237 file { '/etc/default/locale':
242 # set mmap_min_addr to 4096 to mitigate
243 # Linux NULL-pointer dereference exploits
244 site::sysctl { 'mmap_min_addr':
247 site::sysctl { 'perf_event_paranoid':
248 key => 'kernel.perf_event_paranoid',
251 site::sysctl { 'puppet-vfs_cache_pressure':
252 key => 'vm.vfs_cache_pressure',
255 site::alternative { 'editor':
256 linkto => '/usr/bin/vim.basic',
258 site::alternative { 'view':
259 linkto => '/usr/bin/vim.basic',
261 mailalias { 'samhain-reports':
263 recipient => $samhain_recipients,
264 require => Package['debian.org']
268 recipient => $root_mail_alias,
269 require => Package['debian.org']
272 file { '/usr/local/bin/check_for_updates':
273 source => 'puppet:///modules/debian_org/check_for_updates',
278 file { '/usr/local/bin/dsa-is-shutdown-scheduled':
279 source => 'puppet:///modules/debian_org/dsa-is-shutdown-scheduled',
283 exec { 'dpkg-reconfigure tzdata -pcritical -fnoninteractive':
284 path => '/usr/bin:/usr/sbin:/bin:/sbin',
287 exec { 'service puppetmaster restart':
290 exec { 'service rc.local restart':
297 exec { 'systemctl daemon-reload':
299 onlyif => "test -x /bin/systemctl"
302 exec { 'systemd-tmpfiles --create --exclude-prefix=/dev':
304 onlyif => "test -x /bin/systemd-tmpfiles"
307 tidy { '/var/lib/puppet/clientbucket/':
311 matches => [ 'paths', 'contents' ],
315 file { '/root/.bashrc':
316 source => 'puppet:///modules/debian_org/root-dotfiles/bashrc',
318 file { '/root/.profile':
319 source => 'puppet:///modules/debian_org/root-dotfiles/profile',
321 file { '/root/.selected_editor':
322 source => 'puppet:///modules/debian_org/root-dotfiles/selected_editor',
324 file { '/root/.screenrc':
325 source => 'puppet:///modules/debian_org/root-dotfiles/screenrc',
327 file { '/root/.tmux.conf':
328 source => 'puppet:///modules/debian_org/root-dotfiles/tmux.conf',
330 file { '/root/.vimrc':
331 source => 'puppet:///modules/debian_org/root-dotfiles/vimrc',
334 if versioncmp($::lsbmajdistrelease, '9') >= 0 { # older puppets do facts as strings.
335 if $::processorcount > 1 {
336 package { 'irqbalance': ensure => installed }
341 # https://www.decadent.org.uk/ben/blog/bpf-security-issues-in-debian.html
342 site::sysctl { 'unprivileged_bpf_disabled':
343 key => 'kernel.unprivileged_bpf_disabled',
347 # Disable kpartx udev rules
348 file { '/etc/udev/rules.d/60-kpartx.rules':
349 ensure => $has_lib_udev_rules_d_60_kpartx_rules ? { true => 'present', default => 'absent' },
354 # this is only to avoid warnings, else puppet will complain that we
355 # have a symlink there, even if we're not replacing it anyhow.
356 if ! $has_etc_ssh_ssh_known_hosts {
357 file { '/etc/ssh/ssh_known_hosts':
360 content => inline_template('<%= open("/etc/ssh/ssh_known_hosts").read() %>'),
361 notify => Exec['ud-replicate'],
365 exec { 'ud-replicate':
366 path => '/usr/bin:/usr/sbin:/bin:/sbin',
367 command => '/usr/bin/ud-replicate',
369 require => Package['userdir-ldap']