class nodo::subsystem::sysctl::panic($seconds = lookup('nodo::sysctl::panic', undef, undef, '20')) { # See https://www.systutorials.com/how-to-make-linux-automatically-reboot-after-a-kernel-panic/ # https://unix.stackexchange.com/questions/29567/how-to-early-configure-linux-kernel-to-reboot-on-panic # https://sysctl-explorer.net/kernel/panic/ file { "/etc/sysctl.d/kernel.panic.conf": owner => "root", group => "root", mode => '0644', ensure => present, content => "kernel.panic = ${seconds}\n", } exec { "/bin/echo '${seconds}' > /proc/sys/kernel/panic": subscribe => File["/etc/sysctl.d/kernel.panic.conf"], refreshonly => true, } }