summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-04-19 16:01:44 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-04-19 16:29:06 +0200
commit71e8cb8073ad3407effe3dd1252c3ab9be7722ec (patch)
treec3451dbab0d86a1acfd5fb1d8784223f54a60e78
parentChange path escape rules. (diff)
downloadsystemd_mount-71e8cb8073ad3407effe3dd1252c3ab9be7722ec.tar.gz
systemd_mount-71e8cb8073ad3407effe3dd1252c3ab9be7722ec.tar.xz
Allow options to system_mount.
-rw-r--r--manifests/init.pp4
-rw-r--r--templates/mount.epp2
2 files changed, 5 insertions, 1 deletions
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(',') %><% } %>