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 1/2] 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 From eafea56b188366582206018e3ca817fa5c1ebfe7 Mon Sep 17 00:00:00 2001 From: anarcat Date: Fri, 17 Jan 2025 09:09:43 -0500 Subject: [PATCH 2/2] service templates: clarify what "it" is Co-authored-by: Steve Traylen --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 50353838..26b6f0e9 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ 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 +simply enable an instance of the template with a `service` resource. This, for example, will enable the `foo@bar` service unit, based on the `foo@` template: ```puppet