summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-11-15 03:26:49 -0500
committerJesse Luehrs <doy@tozt.net>2018-11-15 03:26:49 -0500
commitfd3a7e9f7abd929a9deb69b0282d95d34961ed0c (patch)
tree1e0055f66a7c68098875867f1091c482ea161a7b
parentebbbabe8a4b2a2597470aee2b306a11573bd65f1 (diff)
downloadpuppet-tozt-fd3a7e9f7abd929a9deb69b0282d95d34961ed0c.tar.gz
puppet-tozt-fd3a7e9f7abd929a9deb69b0282d95d34961ed0c.zip
install smartd for hard disk monitoring
-rw-r--r--manifests/partofme.pp1
-rw-r--r--modules/partofme/monitoring.pp3
-rw-r--r--modules/smartmontools/files/smartd.conf1
-rw-r--r--modules/smartmontools/manifests/init.pp18
4 files changed, 23 insertions, 0 deletions
diff --git a/manifests/partofme.pp b/manifests/partofme.pp
index 7951601..5390bbd 100644
--- a/manifests/partofme.pp
+++ b/manifests/partofme.pp
@@ -5,4 +5,5 @@ node 'partofme.localdomain' {
include partofme::backups
include partofme::filesharing
+ include partofme::monitoring
}
diff --git a/modules/partofme/monitoring.pp b/modules/partofme/monitoring.pp
new file mode 100644
index 0000000..f03d36e
--- /dev/null
+++ b/modules/partofme/monitoring.pp
@@ -0,0 +1,3 @@
+class partofme::monitoring {
+ include smartmontools
+}
diff --git a/modules/smartmontools/files/smartd.conf b/modules/smartmontools/files/smartd.conf
new file mode 100644
index 0000000..17e93c9
--- /dev/null
+++ b/modules/smartmontools/files/smartd.conf
@@ -0,0 +1 @@
+DEVICESCAN -s (S/../.././20|L/../../6/03)
diff --git a/modules/smartmontools/manifests/init.pp b/modules/smartmontools/manifests/init.pp
new file mode 100644
index 0000000..76bc09b
--- /dev/null
+++ b/modules/smartmontools/manifests/init.pp
@@ -0,0 +1,18 @@
+class smartmontools {
+ package { 'smartmontools':
+ ensure => installed;
+ }
+
+ file { '/etc/smartd.conf':
+ source => 'puppet:///modules/smartmontools/smartd.conf';
+ }
+
+ service { 'smartd':
+ enable => true,
+ ensure => running,
+ require => [
+ Package['smartmontools'],
+ File['/etc/smartd.conf'],
+ ]
+ }
+}