summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-02-09 19:38:34 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-02-09 19:43:41 +0100
commite78e922b1ec0b5cda507351d0c6408b84293b78b (patch)
treee18a3db0ee6a234988a4c01ece7a1340106010b3
parentSystemd_mount where = $name (diff)
downloadsystemd_mount-e78e922b1ec0b5cda507351d0c6408b84293b78b.tar.gz
systemd_mount-e78e922b1ec0b5cda507351d0c6408b84293b78b.tar.xz
Change path escape rules.
-rw-r--r--manifests/init.pp8
1 files changed, 7 insertions, 1 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 7938555..b7eef59 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -5,7 +5,13 @@ define systemd_mount (
String $wantedBy = 'default.target',
) {
- $mostly_fixed = regsubst($where, '/', '-', 'G')
+ $mostly_fixed = $where.map |$c| {
+ $c ? {
+ '/' => '-',
+ '-' => '\\x2d',
+ default => $c,
+ }
+ }.join('')
$fixed = if $mostly_fixed[0] == '-' {
$mostly_fixed[1, -1] # drop first char
} else {