diff options
-rw-r--r-- | manifests/init.pp | 4 | ||||
-rw-r--r-- | templates/mount.epp | 2 |
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(',') %><% } %> |