summaryrefslogtreecommitdiffstats
path: root/modules/systemd
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-03-21 14:36:28 -0400
committerJesse Luehrs <doy@tozt.net>2021-03-21 14:36:28 -0400
commit93eb874eb2ebcf1673c9aabd4b3d8d1a34265848 (patch)
treea679e7af9b62b268bb14f9e292c81cc70593e040 /modules/systemd
parent2fdee0d1196dc57cb4ca109182c903a2fc70deb1 (diff)
downloadpuppet-tozt-93eb874eb2ebcf1673c9aabd4b3d8d1a34265848.tar.gz
puppet-tozt-93eb874eb2ebcf1673c9aabd4b3d8d1a34265848.zip
factor out defining a systemd service
Diffstat (limited to 'modules/systemd')
-rw-r--r--modules/systemd/manifests/override.pp5
-rw-r--r--modules/systemd/manifests/service.pp12
2 files changed, 16 insertions, 1 deletions
diff --git a/modules/systemd/manifests/override.pp b/modules/systemd/manifests/override.pp
index 976dc08..c605382 100644
--- a/modules/systemd/manifests/override.pp
+++ b/modules/systemd/manifests/override.pp
@@ -7,7 +7,10 @@ define systemd::override($source = undef, $content = undef) {
"/etc/systemd/system/${name}.service.d/override.conf":
source => $source,
content => $content,
- notify => Exec['/usr/bin/systemctl daemon-reload'],
+ notify => [
+ Exec['/usr/bin/systemctl daemon-reload'],
+ Service["${name}"]
+ ],
require => File["/etc/systemd/system/${name}.service.d"];
}
}
diff --git a/modules/systemd/manifests/service.pp b/modules/systemd/manifests/service.pp
new file mode 100644
index 0000000..87a1dc9
--- /dev/null
+++ b/modules/systemd/manifests/service.pp
@@ -0,0 +1,12 @@
+define systemd::service($source = undef, $content = undef) {
+ include systemd
+
+ file { "/usr/lib/systemd/system/${name}.service":
+ source => $source,
+ content => $content,
+ notify => [
+ Exec["/usr/bin/systemctl daemon-reload"],
+ Service["${name}"],
+ ];
+ }
+}