summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-07-03 12:26:08 -0400
committerJesse Luehrs <doy@tozt.net>2021-07-03 12:26:08 -0400
commitc3278f99d04c6d3c82a8c3697067ad1081e0b790 (patch)
tree2da094f081cb541ffd2bfe741f7dda117c9c17b8
parentf7cefac7c49168057fd1a86ce179673685912033 (diff)
downloadpuppet-tozt-c3278f99d04c6d3c82a8c3697067ad1081e0b790.tar.gz
puppet-tozt-c3278f99d04c6d3c82a8c3697067ad1081e0b790.zip
try a udev-based approach
-rw-r--r--modules/partofme/files/99-media-persistent.rules1
-rw-r--r--modules/partofme/manifests/persistent.pp4
2 files changed, 5 insertions, 0 deletions
diff --git a/modules/partofme/files/99-media-persistent.rules b/modules/partofme/files/99-media-persistent.rules
new file mode 100644
index 0000000..8cd261d
--- /dev/null
+++ b/modules/partofme/files/99-media-persistent.rules
@@ -0,0 +1 @@
+SUBSYSTEM=="block" DM_NAME="partofme-data" RUN+="mount /media/persistent" RUN+="systemctl start pihole"
diff --git a/modules/partofme/manifests/persistent.pp b/modules/partofme/manifests/persistent.pp
index cc12447..0373565 100644
--- a/modules/partofme/manifests/persistent.pp
+++ b/modules/partofme/manifests/persistent.pp
@@ -23,4 +23,8 @@ class partofme::persistent {
unless => "/usr/bin/grep -qF '${fstab_line}' /etc/fstab",
require => File["/media/persistent"],
}
+
+ file { "/etc/udev/rules.d/99-local.rules":
+ source => "puppet:///modules/partofme/99-media-persistent.rules";
+ }
}