]> xn--ix-yja.es Git - alex.git/commitdiff
Allow disabling Nagios monitoring
authoralex <alex@pdp7.net>
Thu, 3 Oct 2024 19:17:33 +0000 (21:17 +0200)
committeralexpdp7 <alex@corcoles.net>
Thu, 3 Oct 2024 19:19:39 +0000 (21:19 +0200)
personal_infra/puppet/site/00-common.pp

index b9f2a6f71ef262f9e299b6b9c775faf262907349..8ebc3167abf6e492fa8eee6014dd36ff537b7e79 100644 (file)
@@ -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