diff options
Diffstat (limited to 'manifests/subsystem/sensors.pp')
-rw-r--r-- | manifests/subsystem/sensors.pp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/manifests/subsystem/sensors.pp b/manifests/subsystem/sensors.pp new file mode 100644 index 0000000..8a19831 --- /dev/null +++ b/manifests/subsystem/sensors.pp @@ -0,0 +1,56 @@ +class nodo::subsystem::sensors { + # + # SMART monitoring + # + + $smartmontools = lookup('nodo::sensors::smartmontools', undef, undef, 'present') + + if $smartmontools == 'present' { + class { 'smartmontools': } + } + + # + # LM Sensors + # + + $lm_sensors = lookup('nodo::sensors::lm_sensors', undef, undef, 'present') + + package { [ + 'lm-sensors', + ]: + ensure => $lm_sensors, + } + + # + # drivetemp + # + # Just load this driver and lm-sensors will detect sensors automatically. + # + # 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 + + $drivetemp = lookup('nodo::sensors::drivetemp', undef, undef, 'present') + + nodo::subsystem::modprobe::module { 'drivetemp': + ensure => $drivetemp, + } + + # + # hddtemp + # + + # Deprecated in favor of drivetemp: + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1002484 + package { [ + 'hddtemp', + ]: + ensure => $::lsbdistcodename ? { + 'wheezy' => present, + 'buster' => present, + 'bullseye' => present, + default => absent, + } + } +} |