diff --git a/manifests/feature/icingadb.pp b/manifests/feature/icingadb.pp index 1ad7462..ff5e39a 100644 --- a/manifests/feature/icingadb.pp +++ b/manifests/feature/icingadb.pp @@ -1,66 +1,70 @@ # @summary # Configures the Icinga 2 feature icingadb. # # @param [Enum['absent', 'present']] ensure # Set to present, enables the feature icingadb, absent disabled it. # # @param [Optional[Stdlib::Host]] host # IcingaDB Redis host address. # # @param [Optional[Stdlib::Port::Unprivileged]] port # IcingaDB Redis port. # # @param [Optional[Stdlib::Absolutepath]] socket_path # IcingaDB Redis unix sockt. Can be used instead of host and port attributes. # +# @param [Optional[Icinga2::Interval]] connect_timeout +# Timeout for establishing new connections. +# # @param [Optional[String]] password # IcingaDB Redis password. The password parameter isn't parsed anymore. # class icinga2::feature::icingadb( - Enum['absent', 'present'] $ensure = present, - Optional[Stdlib::Host] $host = undef, - Optional[Stdlib::Port::Unprivileged] $port = undef, - Optional[Stdlib::Absolutepath] $socket_path = undef, - Optional[String] $password = undef, + Enum['absent', 'present'] $ensure = present, + Optional[Stdlib::Host] $host = undef, + Optional[Stdlib::Port::Unprivileged] $port = undef, + Optional[Stdlib::Absolutepath] $socket_path = undef, + Optional[Icinga2::Interval] $connect_timeout = undef, + Optional[String] $password = undef, ) { if ! defined(Class['::icinga2']) { fail('You must include the icinga2 base class before using any icinga2 feature class!') } $conf_dir = $::icinga2::globals::conf_dir $_notify = $ensure ? { 'present' => Class['::icinga2::service'], default => undef, } # The password parameter isn't parsed anymore. if $password { $_password = "-:\"${password}\"" } else { $_password = undef } # compose attributes $attrs = { host => $host, port => $port, path => $socket_path, password => $_password, } # create object icinga2::object { 'icinga2::object::IcingaDB::icingadb': object_name => 'icingadb', object_type => 'IcingaDB', attrs => delete_undef_values($attrs), attrs_list => keys($attrs), target => "${conf_dir}/features-available/icingadb.conf", order => 10, notify => $_notify, } # manage feature icinga2::feature { 'icingadb': ensure => $ensure, } }