summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-11-06 16:11:43 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-11-06 21:43:20 +0100
commita5ed20b2aadc9359ca3add08cd7ddfdcab039f34 (patch)
tree3e27ab63ececf78f79b0e5a503992eb11218677f /functions
parentAdd puppet notice to generated sytemd files. (diff)
downloadnetworking-a5ed20b2aadc9359ca3add08cd7ddfdcab039f34.tar.gz
networking-a5ed20b2aadc9359ca3add08cd7ddfdcab039f34.tar.xz
Allow for lists in unit files.
Diffstat (limited to 'functions')
-rw-r--r--functions/repack.pp7
1 files changed, 7 insertions, 0 deletions
diff --git a/functions/repack.pp b/functions/repack.pp
new file mode 100644
index 0000000..396354c
--- /dev/null
+++ b/functions/repack.pp
@@ -0,0 +1,7 @@
+# Normalizes a hash or a list of hashes to a list of hashes
+function networking::repack(Variant[Hash, Array[Hash]] $data) >> Array[Hash] {
+ $data ? {
+ Hash => [$data],
+ _ => $data,
+ }
+}