Avoid conflict with 3rdparty.
file { '/etc/systemd/system/bacula-fd.service.d/user.conf':
ensure => absent,
}
- systemd::override { 'bacula-fd':
+ dsa_systemd::override { 'bacula-fd':
content => @(EOT)
[Service]
ExecStart=
file { '/etc/systemd/system/bacula-fd.service.d/user.conf':
ensure => absent,
}
- systemd::override { 'bacula-fd':
+ dsa_systemd::override { 'bacula-fd':
ensure => absent,
}
}
hasstatus => true,
require => Package['bacula-director-pgsql']
}
- systemd::override { 'bacula-director':
+ dsa_systemd::override { 'bacula-director':
content => @(EOT)
[Unit]
After=unbound.service
enable => true,
hasstatus => true,
}
- systemd::override { 'bacula-sd':
+ dsa_systemd::override { 'bacula-sd':
content => @(EOT)
[Service]
Group=bacula
mode => '755',
}
file { '/etc/systemd/journald.conf.d/persistency.conf':
- source => 'puppet:///modules/systemd/persistency.conf',
+ source => 'puppet:///modules/dsa_systemd/persistency.conf',
}
# Make sure that the build directory have the correct permissions.
include debian_org::apt
if $systemd {
- include systemd
+ include dsa_systemd
$servicefiles = 'present'
} else {
$servicefiles = 'absent'
--- /dev/null
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+[Journal]
+ForwardToSyslog=no
--- /dev/null
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+[Journal]
+Storage=persistent
--- /dev/null
+#!/bin/bash
+
+# if a client goes away on socket activated connections before systemd launches
+# the process, things go sad and result in failed services.
+#
+# cf. https://github.com/systemd/systemd/issues/7172
+#
+# should be fixed in buster and newer, but for now clean those up.
+
+systemctl --failed --no-legend | awk '{print $1}' | \
+ while read service; do
+ if [[ $service =~ ^rsyncd-[a-z0-9-]*@.*\.service$ ]] ||
+ [[ $service =~ ^session-[0-9]+\.scope$ ]]; then
+ systemctl reset-failed "$service"
+ fi
+done
--- /dev/null
+class dsa_systemd {
+ file { '/etc/systemd/journald.conf':
+ source => 'puppet:///modules/dsa_systemd/journald.conf',
+ }
+
+ dsa_systemd::mask { 'sys-kernel-debug-tracing.mount': }
+ dsa_systemd::mask { 'sys-kernel-debug.mount': }
+
+ include stretch::network_online
+
+ if $::hostname == 'godard' {
+ exec {'mkdir -p /etc/systemd/journald.conf.d':
+ unless => 'test -d /etc/systemd/journald.conf.d',
+ }
+ file { '/etc/systemd/journald.conf.d/persistency.conf':
+ source => 'puppet:///modules/dsa_systemd/persistency.conf',
+ }
+ }
+
+ file { '/usr/local/sbin/systemd-cleanup-failed':
+ source => 'puppet:///modules/dsa_systemd/systemd-cleanup-failed',
+ mode => '0555',
+ }
+ concat::fragment { 'dsa-puppet-stuff--systemd-cleanup-failed':
+ target => '/etc/cron.d/dsa-puppet-stuff',
+ content => @("EOF"),
+ */10 * * * * root /usr/local/sbin/systemd-cleanup-failed
+ | EOF
+ }
+}
--- /dev/null
+define dsa_systemd::mask (
+ $ensure = present,
+ ) {
+ $filename = "/etc/systemd/system/${name}"
+
+ case $ensure {
+ present: {
+ $linkensure = "link"
+ }
+ absent: {
+ $linkensure = "absent"
+ }
+ default: { fail ( "Unknown ensure value: '$ensure'" ) }
+ }
+
+ file { $filename:
+ ensure => $linkensure,
+ target => '/dev/null',
+ notify => Exec['systemctl daemon-reload'],
+ }
+}
--- /dev/null
+define dsa_systemd::override (
+ $source=undef,
+ $content=undef,
+ $ensure=present
+) {
+
+ $dir = "/etc/systemd/system/${name}.service.d"
+ $dest = "${dir}/override.conf"
+ case $ensure {
+ present: {
+ if ! ($source or $content) {
+ fail ( "No configuration found for ${name}" )
+ }
+
+ file { "${dir}":
+ ensure => directory,
+ mode => '0755'
+ }
+ if $content {
+ file { "${dest}":
+ ensure => $ensure,
+ content => $content,
+ notify => [ Exec['systemctl daemon-reload'],
+ Service["${name}"],
+ ]
+ }
+ } elsif $source {
+ file { "${dest}":
+ ensure => $ensure,
+ source => $source,
+ notify => [ Exec['systemctl daemon-reload'],
+ Service["${name}"],
+ ]
+ }
+ }
+ }
+ absent: {
+ if defined(Service["${name}"]) {
+ $notify = [ Exec['systemctl daemon-reload'], Service["${name}"] ]
+ } else {
+ $notify = [ Exec['systemctl daemon-reload'] ]
+ }
+
+ file { "${dest}":
+ ensure => $ensure,
+ notify => $notify,
+ }
+ file { "${dir}":
+ ensure => $ensure
+ }
+ }
+ default: { fail ( "Unknown ensure value: '$ensure'" ) }
+ }
+}
}
# work around #858134
- systemd::override { 'haveged':
+ dsa_systemd::override { 'haveged':
ensure => $ensure,
content => @(EOT)
[Unit]
ensure => running,
require => Package['munin-async'],
}
- systemd::override { 'munin-async':
+ dsa_systemd::override { 'munin-async':
content => @("EOF"),
[Service]
RestartSec=10
ensure => running,
require => Package['onionbalance'],
}
- systemd::override { 'onionbalance':
+ dsa_systemd::override { 'onionbalance':
ensure => $ensure,
content => @(EOT)
[Unit]
service { 'repro':
ensure => running,
}
- systemd::override { 'repro':
+ dsa_systemd::override { 'repro':
content => @("EOF"),
[Unit]
After=network-online.target
+++ /dev/null
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-
-[Journal]
-ForwardToSyslog=no
+++ /dev/null
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-
-[Journal]
-Storage=persistent
+++ /dev/null
-#!/bin/bash
-
-# if a client goes away on socket activated connections before systemd launches
-# the process, things go sad and result in failed services.
-#
-# cf. https://github.com/systemd/systemd/issues/7172
-#
-# should be fixed in buster and newer, but for now clean those up.
-
-systemctl --failed --no-legend | awk '{print $1}' | \
- while read service; do
- if [[ $service =~ ^rsyncd-[a-z0-9-]*@.*\.service$ ]] ||
- [[ $service =~ ^session-[0-9]+\.scope$ ]]; then
- systemctl reset-failed "$service"
- fi
-done
+++ /dev/null
-class systemd {
- file { '/etc/systemd/journald.conf':
- source => 'puppet:///modules/systemd/journald.conf',
- }
-
- systemd::mask { 'sys-kernel-debug-tracing.mount': }
- systemd::mask { 'sys-kernel-debug.mount': }
-
- include stretch::network_online
-
- if $::hostname == 'godard' {
- exec {'mkdir -p /etc/systemd/journald.conf.d':
- unless => 'test -d /etc/systemd/journald.conf.d',
- }
- file { '/etc/systemd/journald.conf.d/persistency.conf':
- source => 'puppet:///modules/systemd/persistency.conf',
- }
- }
-
- file { '/usr/local/sbin/systemd-cleanup-failed':
- source => 'puppet:///modules/systemd/systemd-cleanup-failed',
- mode => '0555',
- }
- concat::fragment { 'dsa-puppet-stuff--systemd-cleanup-failed':
- target => '/etc/cron.d/dsa-puppet-stuff',
- content => @("EOF"),
- */10 * * * * root /usr/local/sbin/systemd-cleanup-failed
- | EOF
- }
-}
+++ /dev/null
-define systemd::mask (
- $ensure = present,
- ) {
- $filename = "/etc/systemd/system/${name}"
-
- case $ensure {
- present: {
- $linkensure = "link"
- }
- absent: {
- $linkensure = "absent"
- }
- default: { fail ( "Unknown ensure value: '$ensure'" ) }
- }
-
- file { $filename:
- ensure => $linkensure,
- target => '/dev/null',
- notify => Exec['systemctl daemon-reload'],
- }
-}
+++ /dev/null
-define systemd::override (
- $source=undef,
- $content=undef,
- $ensure=present
-) {
-
- $dir = "/etc/systemd/system/${name}.service.d"
- $dest = "${dir}/override.conf"
- case $ensure {
- present: {
- if ! ($source or $content) {
- fail ( "No configuration found for ${name}" )
- }
-
- file { "${dir}":
- ensure => directory,
- mode => '0755'
- }
- if $content {
- file { "${dest}":
- ensure => $ensure,
- content => $content,
- notify => [ Exec['systemctl daemon-reload'],
- Service["${name}"],
- ]
- }
- } elsif $source {
- file { "${dest}":
- ensure => $ensure,
- source => $source,
- notify => [ Exec['systemctl daemon-reload'],
- Service["${name}"],
- ]
- }
- }
- }
- absent: {
- if defined(Service["${name}"]) {
- $notify = [ Exec['systemctl daemon-reload'], Service["${name}"] ]
- } else {
- $notify = [ Exec['systemctl daemon-reload'] ]
- }
-
- file { "${dest}":
- ensure => $ensure,
- notify => $notify,
- }
- file { "${dir}":
- ensure => $ensure
- }
- }
- default: { fail ( "Unknown ensure value: '$ensure'" ) }
- }
-}
$listenarr = [] + $listen
$listenstr = join(prefix($listenarr, "-a "), " ")
- systemd::override { 'varnish':
+ dsa_systemd::override { 'varnish':
content => @("EOF"),
[Unit]
After=network-online.target