diff --git a/manifests/config.pp b/manifests/config.pp index 7e51bd5..1f33c50 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -37,17 +37,13 @@ $_piddir = dirname($opendkim::pidfile) if fact('os.family') == 'RedHat' { - file_line { "${opendkim::service_name}.service RuntimeDirectory": - path => "/usr/lib/systemd/system/${opendkim::service_name}.service", - line => "RuntimeDirectory=${basename($_piddir)}", - match => '^RuntimeDirectory=', - after => '^Restart=', - } - -> file_line { "${opendkim::service_name}.service RuntimeDirectoryMode": - path => "/usr/lib/systemd/system/${opendkim::service_name}.service", - line => "RuntimeDirectoryMode=${opendkim::rundir_mode}", - match => '^RuntimeDirectoryMode=', - after => '^RuntimeDirectory=', + systemd::manage_dropin { "${opendkim::service_name}.service.d/RuntimeDirectory.conf": + unit => "${opendkim::service_name}.service", + filename => 'RuntimeDirectory.conf', + service_entry => { + 'RuntimeDirectory' => basename($_piddir), + 'RuntimeDirectoryMode' => $opendkim::rundir_mode, + }, } file { '/etc/tmpfiles.d/opendkim.conf': diff --git a/manifests/init.pp b/manifests/init.pp index 35c2762..8dd2085 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -146,13 +146,13 @@ Optional[Variant[Boolean,Enum['yes','no']]] $autorestart = undef, Optional[Pattern[/\A[0-9]+\/[0-9]+[sSmMhHdD]\z/]] $autorestartrate = undef, ) { - contain opendkim::install contain opendkim::user + contain opendkim::install contain opendkim::config contain opendkim::service - Class['opendkim::install'] - -> Class['opendkim::user'] + Class['opendkim::user'] + -> Class['opendkim::install'] -> Class['opendkim::config'] ~> Class['opendkim::service'] } diff --git a/metadata.json b/metadata.json index c54afad..05ca834 100644 --- a/metadata.json +++ b/metadata.json @@ -53,6 +53,10 @@ { "name": "puppetlabs/stdlib", "version_requirement": ">= 4.13.0 < 10.0.0" + }, + { + "name": "puppet/systemd", + "version_requirement": ">= 6.1.0 < 8.0.0" } ], "requirements": [