diff --git a/manifests/icinga2/objects/templates.pp b/manifests/icinga2/objects/templates.pp index 16e00899..3fc29b64 100644 --- a/manifests/icinga2/objects/templates.pp +++ b/manifests/icinga2/objects/templates.pp @@ -1,48 +1,51 @@ # Icinga2 object template definitions class profile::icinga2::objects::templates { + + $template_file = '/etc/icinga2/conf.d/templates.conf' + ::icinga2::object::host {'generic-host': template => true, max_check_attempts => 3, check_interval => '1m', retry_interval => '30s', check_command => 'hostalive', - target => '/etc/icinga2/conf.d/templates.conf', + target => $template_file, } ::icinga2::object::service {'generic-service': template => true, max_check_attempts => 5, check_interval => '1m', retry_interval => '30s', - target => '/etc/icinga2/conf.d/templates.conf', + target => $template_file, } ::icinga2::object::user {'generic-user': template => true, - target => '/etc/icinga2/conf.d/templates.conf', + target => $template_file, } ::icinga2::object::notification {'mail-host-notification': template => true, command => 'mail-host-notification', states => ['Up', 'Down'], types => [ 'Problem', 'Acknowledgement', 'Recovery', 'Custom', 'FlappingStart', 'FlappingEnd', 'DowntimeStart', 'DowntimeEnd', 'DowntimeRemoved', ], period => '24x7', - target => '/etc/icinga2/conf.d/templates.conf', + target => $template_file, } ::icinga2::object::notification {'mail-service-notification': template => true, command => 'mail-service-notification', states => ['OK', 'Warning', 'Critical', 'Unknown' ], types => [ 'Problem', 'Acknowledgement', 'Recovery', 'Custom', 'FlappingStart', 'FlappingEnd', 'DowntimeStart', 'DowntimeEnd', 'DowntimeRemoved', ], period => '24x7', - target => '/etc/icinga2/conf.d/templates.conf', + target => $template_file, } }