From bba0d2ce6a523b3a812d8f6899487b6a49581d68 Mon Sep 17 00:00:00 2001
From: Thomas Bellman <bellman@lysator.liu.se>
Date: Fri, 22 Apr 2022 13:49:00 +0200
Subject: [PATCH] Contain daemon_reload within unit/unit_options.

Use 'contain systemd::daemon_reload' instead of 'include' in the
systemd::unit and systemd::unit_options definitions.  This allows
users to specify their unit/unit_options resources in dependencies,
and be sure that systemd has reloaded the new units before they
try to use them.
---
 manifests/unit.pp         | 2 +-
 manifests/unit_options.pp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/manifests/unit.pp b/manifests/unit.pp
index 674df7a..e1d985b 100644
--- a/manifests/unit.pp
+++ b/manifests/unit.pp
@@ -67,7 +67,7 @@ define systemd::unit(
 )
 {
     include systemd::vars
-    include systemd::daemon_reload
+    contain systemd::daemon_reload
 
     if ($name !~ /^([^\/.]+)\.([^\/.]+)$/)
     {
diff --git a/manifests/unit_options.pp b/manifests/unit_options.pp
index 5387c65..badfa20 100644
--- a/manifests/unit_options.pp
+++ b/manifests/unit_options.pp
@@ -58,7 +58,7 @@ define systemd::unit_options(
 )
 {
     include systemd::vars
-    include systemd::daemon_reload
+    contain systemd::daemon_reload
 
     if ($name =~ /^([^\/.]+)\.([^\/.]+)\/(.+)$/) {
 	$unitname = $1
-- 
GitLab