aboutsummaryrefslogtreecommitdiff
path: root/manifests/base
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-07-05 12:16:36 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-07-05 12:16:36 -0300
commit2d9347f596d6f3c191a99ca29e8085e2000759c3 (patch)
treeb1ed3eb49732b24612eafb38b67a3de900cc2f9c /manifests/base
parent774c13638a06ef5a79a89dbe3f2a308f530a43be (diff)
downloadpuppet-nodo-2d9347f596d6f3c191a99ca29e8085e2000759c3.tar.gz
puppet-nodo-2d9347f596d6f3c191a99ca29e8085e2000759c3.tar.bz2
Fix: nodo::base::physical: replaces hddtemp with drivetemp
Diffstat (limited to 'manifests/base')
-rw-r--r--manifests/base/physical.pp37
1 files changed, 36 insertions, 1 deletions
diff --git a/manifests/base/physical.pp b/manifests/base/physical.pp
index 1c57388..1eadbe9 100644
--- a/manifests/base/physical.pp
+++ b/manifests/base/physical.pp
@@ -24,7 +24,8 @@ class nodo::base::physical inherits nodo::base::host {
ensure => $downtimed,
}
- # Deprecated
+ # Deprecated in favor of drivetemp
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1002484
package { [
'hddtemp',
]:
@@ -35,4 +36,38 @@ class nodo::base::physical inherits nodo::base::host {
default => absent,
}
}
+
+ # We'll implement drive temp module loading both for SysV and systemd based
+ # systems, to ensure this module is managed in either case.
+ #
+ # It also remains to be tested whether _both_ /etc/modules and /etc/modules-load.d
+ # are processed by recent systemd-based Debian systems; or if there are
+ # inconsistencies between the implementation and the documentation:
+ #
+ # https://wiki.debian.org/Modules#Automatic_loading_of_modules
+ #
+ # Anyway, having this configuration in both places does not seem to hurt (much).
+ $drivetemp = lookup('nodo::drivetemp', undef, undef, 'present')
+
+ # Drivetemp: implementation for systems using SysV -- /etc/modules - modules(5)
+ file_line { 'etc-modules-drivetemp':
+ path => "/etc/modules",
+ line => "drivetemp",
+ ensure => $drivetemp,
+ }
+
+ # Drivetemp: implementation using systemd's /etc/modules-load.d/ - modules-load.d(5)
+ #
+ # https://www.baeldung.com/linux/hdd-ssd-temperature
+ # https://askubuntu.com/questions/1426482/tool-to-monitor-hdd-temperature-in-ubuntu-server-22-04
+ # https://wiki.archlinux.org/title/Lm_sensors#S.M.A.R.T._drive_temperature
+ # https://github.com/philipl/drivetemp
+ # https://wiki.archlinux.org/title/Kernel_module#Automatic_module_loading
+ file { '/etc/modules-load.d/drivetemp.conf':
+ ensure => $drivetemp,
+ owner => root,
+ group => root,
+ mode => '0644',
+ content => "drivetemp\n",
+ }
}