From 71e8cb8073ad3407effe3dd1252c3ab9be7722ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 19 Apr 2022 16:01:44 +0200 Subject: Allow options to system_mount. --- manifests/init.pp | 4 +++- templates/mount.epp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index b7eef59..7b50c02 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -3,6 +3,7 @@ define systemd_mount ( String $where = $name, # /usr/net Boolean $automount = false, String $wantedBy = 'default.target', + Array[String] $options = [], ) { $mostly_fixed = $where.map |$c| { @@ -22,13 +23,14 @@ define systemd_mount ( content => epp('systemd_mount/mount.epp', { what => $what, where => $where, + options => $options, wantedby => if ($automount) { '' } else { "WantedBy=${wantedBy}" }, }), } if ($automount) { systemd::unit_file { "${fixed}.automount": - content => epp('systemd_mount/automount.epp', { + content => epp('systemd_mount/automount.epp', { where => $where, wantedBy => "WantedBy=${wantedBy}", }), diff --git a/templates/mount.epp b/templates/mount.epp index 54d191a..af76c85 100644 --- a/templates/mount.epp +++ b/templates/mount.epp @@ -1,6 +1,7 @@ <%- | String $where, String $what, String $wantedby, + Array[String] $options, | -%> [Unit] @@ -11,3 +12,4 @@ [Mount] Where=<%= $where %> What=<%= $what %> +<% if $options != [] { %>Options=<%= $options.join(',') %><% } %> -- cgit v1.2.3