summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/mounts.pp16
-rw-r--r--manifests/mounts/instance.pp19
2 files changed, 23 insertions, 12 deletions
diff --git a/manifests/mounts.pp b/manifests/mounts.pp
index 893352f..daf0c4a 100644
--- a/manifests/mounts.pp
+++ b/manifests/mounts.pp
@@ -1,8 +1,6 @@
-class profiles::mounts {
-
- file { '/usr/net':
- ensure => directory,
- }
+class profiles::mounts (
+ Hash[String,Hash] $mounts,
+) {
case $facts['os']['family'] {
'Archlinux': {
@@ -13,11 +11,5 @@ class profiles::mounts {
}
}
- systemd_mount { '/usr/net':
- what => 'elrond:/files',
- where => '/usr/net',
- wantedBy => 'remote-fs.target',
- automount => true,
- require => File['/usr/net'],
- }
+ create_resources(profiles::mounts::instance, $mounts)
}
diff --git a/manifests/mounts/instance.pp b/manifests/mounts/instance.pp
new file mode 100644
index 0000000..3b87b81
--- /dev/null
+++ b/manifests/mounts/instance.pp
@@ -0,0 +1,19 @@
+define profiles::mounts::instance (
+ String $what,
+ String $where = $name,
+ Array[String] $options = [],
+) {
+
+ file { $where:
+ ensure => directory,
+ }
+
+ systemd_mount { $where:
+ what => $what,
+ where => $where,
+ wantedBy => 'remote-fs.target',
+ automount => true,
+ require => File[$where],
+ options => $options,
+ }
+}