summaryrefslogtreecommitdiff
path: root/manifests/unit_file.pp
diff options
context:
space:
mode:
authorRaphaël Pinson <github+aem1eeshi1@raphink.net>2016-05-04 09:31:53 +0200
committerRaphaël Pinson <github+aem1eeshi1@raphink.net>2016-05-04 09:31:53 +0200
commit106be55a2469a6b87ac33e0b2fa8bca40ef2cb4d (patch)
tree761ebe4a9b31f80088c551e1f0f123cffb11701d /manifests/unit_file.pp
parent783f6b7a13f21c78d89241b2e5cebe82d80febfb (diff)
parent040f1acf02dc379e3fe577d900b96b47a38a714a (diff)
Merge pull request #4 from felixb/feature/unit-files
Shortcut for creating unit files / tmpfiles
Diffstat (limited to 'manifests/unit_file.pp')
-rw-r--r--manifests/unit_file.pp20
1 files changed, 20 insertions, 0 deletions
diff --git a/manifests/unit_file.pp b/manifests/unit_file.pp
new file mode 100644
index 0000000..0f659db
--- /dev/null
+++ b/manifests/unit_file.pp
@@ -0,0 +1,20 @@
+# -- Define: systemd::unit_file
+# Creates a unit file and reloads systemd
+define systemd::unit_file(
+ $ensure = file,
+ $path = '/etc/systemd/system',
+ $content = undef,
+ $source = undef,
+) {
+ include ::systemd
+
+ file { "${path}/${title}":
+ ensure => $ensure,
+ content => $content,
+ source => $source,
+ owner => 'root',
+ group => 'root',
+ mode => '0444',
+ notify => Exec['systemctl-daemon-reload'],
+ }
+} \ No newline at end of file