From fcdc5c0e8648cf042ca8ca1bab6fbe0292ba77f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= Date: Thu, 16 Jan 2025 15:29:13 -0500 Subject: [PATCH] docs: describe how to deploy systemd templates I've bent over backwards to make this work, while the solution is much simpler than I thought it was. Closes: #510 Replaces: #511 --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 5063f841..50353838 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,22 @@ systemd::unit_file { 'foo.service': } ``` +If you're using "template" units (those with a `@` in it), you can +simply enable it with a `service` resource. This, for example, will +enable the `foo@bar` service unit, based on the `foo@` template: + +```puppet +systemd::unit_file { 'foo@.service': + content => file("${module_name}/foo@.service"), + enable => false, + active => false, +} +service { 'foo@bar.service': + ensure => true, + enable => true, +} +``` + ### unit files from parameters Create a unit file from parameters