diff --git a/manifests/config.pp b/manifests/config.pp index 45b5f6a..6842359 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -12,6 +12,7 @@ group => 0, mode => '0644', content => epp('watchdog/watchdog.conf.epp', { + 'keep_alive' => $watchdog::keep_alive_enabled, 'period' => $period, 'tickle' => $tickle, 'interfaces' => $watchdog::interfaces, diff --git a/manifests/init.pp b/manifests/init.pp index c2275e2..0b1e149 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -12,6 +12,7 @@ # @param service_name Name of the service. # @param interfaces Array of network interfaces to watch, empty by default. # @param pings Array of network addresess to ping, empty by default. +# @param keep_alive_enabled Whether to enable keep alive functionality class watchdog ( Boolean $manage_package, Optional[String] $package_name, @@ -22,6 +23,7 @@ String $service_name, Array[String] $interfaces = [], Array[Stdlib::IP::Address::NoSubnet] $pings = [], + Boolean $keep_alive_enabled = true, ) { contain watchdog::install diff --git a/templates/watchdog.conf.epp b/templates/watchdog.conf.epp index db0dc22..bcb4a20 100644 --- a/templates/watchdog.conf.epp +++ b/templates/watchdog.conf.epp @@ -1,6 +1,8 @@ -<%- | Integer $period, Integer $tickle, Array[String] $interfaces = [], Array[Stdlib::IP::Address::NoSubnet] $pings = [] | -%> +<%- | Boolean $keep_alive = true, Integer $period, Integer $tickle, Array[String] $interfaces = [], Array[Stdlib::IP::Address::NoSubnet] $pings = [] | -%> # !!! Managed by Puppet !!! +<% if $keep_alive { -%> watchdog-device = /dev/watchdog +<% } -%> watchdog-timeout = <%= $period %> interval = <%= $tickle %> realtime = yes