From 344d65baf8502845ab5cc7af59a8cb3a281ef7e2 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 3 Oct 2024 21:17:33 +0200 Subject: [PATCH] Allow disabling Nagios monitoring --- personal_infra/puppet/site/00-common.pp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/personal_infra/puppet/site/00-common.pp b/personal_infra/puppet/site/00-common.pp index b9f2a6f..8ebc316 100644 --- a/personal_infra/puppet/site/00-common.pp +++ b/personal_infra/puppet/site/00-common.pp @@ -6,15 +6,17 @@ if $facts['os']['family'] == 'Debian' { class {'debian':} } -$nagios_host = $facts['networking']['fqdn'] +if lookup({name => 'nagios.monitor', default_value => true}) { + $nagios_host = $facts['networking']['fqdn'] -nagios_host {$nagios_host: - use => 'generic-host', - address => lookup({name => 'nagios.address', default_value => $facts['networking']['fqdn']}), - max_check_attempts => 5, - contact_groups => 'admins', - hostgroups => 'linux', - check_command => 'check-host-alive', + nagios_host {$nagios_host: + use => 'generic-host', + address => lookup({name => 'nagios.address', default_value => $facts['networking']['fqdn']}), + max_check_attempts => 5, + contact_groups => 'admins', + hostgroups => 'linux', + check_command => 'check-host-alive', + } } # https://github.com/alexpdp7/ragent/issues/352 -- 2.47.3