1 # Creates a drop-in file for a systemd unit
7 # @attr name [Pattern['^.+\.conf$']]
8 # The target unit file to create
10 # * Must not contain ``/``
13 # The main systemd configuration path
16 # The full content of the unit file
18 # * Mutually exclusive with ``$source``
21 # The ``File`` resource compatible ``source``
23 # * Mutually exclusive with ``$content``
26 # If set, will force the file to be a symlink to the given target
28 # * Mutually exclusive with both ``$source`` and ``$content``
30 define systemd::dropin_file(
32 Systemd::Dropin $filename = $name,
33 Enum['present', 'absent', 'file'] $ensure = 'present',
34 Stdlib::Absolutepath $path = '/etc/systemd/system',
35 Optional[String] $content = undef,
36 Optional[String] $source = undef,
37 Optional[Stdlib::Absolutepath] $target = undef,
44 $_ensure = $ensure ? {
50 if $ensure != 'absent' {
51 ensure_resource('file', "${path}/${unit}.d", {
58 file { "${path}/${unit}.d/${filename}":
66 notify => Class['systemd::systemctl::daemon_reload'],