Purge nrpe_agent from icinga2 agent nodes
authorJan Dittberner <jandd@cacert.org>
Mon, 29 Jul 2019 14:35:09 +0000 (16:35 +0200)
committerJan Dittberner <jandd@cacert.org>
Mon, 29 Jul 2019 14:35:09 +0000 (16:35 +0200)
16 files changed:
sitemodules/profiles/manifests/icinga2_agent.pp
sitemodules/profiles/manifests/purge_nrpe_agent.pp [new file with mode: 0644]
sitemodules/roles/manifests/bugs.pp
sitemodules/roles/manifests/emailout.pp
sitemodules/roles/manifests/ircserver.pp
sitemodules/roles/manifests/issue.pp
sitemodules/roles/manifests/jenkins.pp
sitemodules/roles/manifests/monitor.pp
sitemodules/roles/manifests/motion.pp
sitemodules/roles/manifests/proxyin.pp
sitemodules/roles/manifests/proxyout.pp
sitemodules/roles/manifests/puppetmaster.pp
sitemodules/roles/manifests/svnserver.pp
sitemodules/roles/manifests/translations.pp
sitemodules/roles/manifests/web.pp
sitemodules/roles/manifests/webstatic.pp

index 0c61ffa..5da7e22 100644 (file)
@@ -91,4 +91,8 @@ class profiles::icinga2_agent (
     endpoints => [$::fqdn],
     parent    => $master_host,
   }
+
+  package { 'monitoring-plugins-basic':
+    ensure => latest,
+  }
 }
diff --git a/sitemodules/profiles/manifests/purge_nrpe_agent.pp b/sitemodules/profiles/manifests/purge_nrpe_agent.pp
new file mode 100644 (file)
index 0000000..c091287
--- /dev/null
@@ -0,0 +1,37 @@
+# Class: profiles::nrpe_agent
+# ===========================
+#
+# This class ensures that the nrpe agent is removed.
+#
+# Examples
+# --------
+#
+# @example
+#   class roles::myhost {
+#     include profiles::nrpe_agent
+#   }
+#
+# Authors
+# -------
+#
+# Jan Dittberner <jandd@cacert.org>
+#
+# Copyright
+# ---------
+#
+# Copyright 2019 Jan Dittberner
+class profiles::purge_nrpe_agent () {
+  package { 'nagios-nrpe-server':
+    ensure => purged,
+  }
+
+  service { 'nagios-nrpe-server':
+    ensure => stopped,
+    enable => false,
+  }
+
+  file { '/etc/nagios':
+    ensure => absent,
+    force  => true,
+  }
+}
index 99a0439..07c8a6a 100644 (file)
@@ -23,6 +23,6 @@
 class roles::bugs {
   include profiles::base
   include profiles::rsyslog
-  include profiles::nrpe_agent
+  include profiles::purge_nrpe_agent
   include profiles::icinga2_agent
 }
index a61a0b5..d6bd462 100644 (file)
@@ -23,6 +23,6 @@
 class roles::emailout {
   include profiles::base
   include profiles::rsyslog
-  include profiles::nrpe_agent
+  include profiles::purge_nrpe_agent
   include profiles::icinga2_agent
 }
index 08ab594..f1ba1a9 100644 (file)
@@ -22,6 +22,6 @@
 class roles::ircserver {
   include profiles::base
   include profiles::rsyslog
-  include profiles::nrpe_agent
+  include profiles::purge_nrpe_agent
   include profiles::icinga2_agent
 }
index 6b2561f..eb3b86b 100644 (file)
@@ -23,6 +23,6 @@
 class roles::issue {
   include profiles::base
   include profiles::rsyslog
-  include profiles::nrpe_agent
+  include profiles::purge_nrpe_agent
   include profiles::icinga2_agent
 }
index 18d1404..0af7fe0 100644 (file)
@@ -23,6 +23,6 @@
 class roles::jenkins {
   include profiles::base
   include profiles::rsyslog
-  include profiles::nrpe_agent
+  include profiles::purge_nrpe_agent
   include profiles::icinga2_agent
 }
index 5736e88..32f8c96 100644 (file)
@@ -23,6 +23,6 @@
 class roles::monitor {
   include profiles::base
   include profiles::rsyslog
-  include profiles::nrpe_agent
+  include profiles::purge_nrpe_agent
   include profiles::icinga2_master
 }
index 8001cfe..3a87255 100644 (file)
 # Copyright
 # ---------
 #
-# Copyright 2017-2018 Jan Dittberner
+# Copyright 2017-2019 Jan Dittberner
 #
 class roles::motion {
   include profiles::base
   include profiles::rsyslog
-  include profiles::nrpe_agent
+  include profiles::purge_nrpe_agent
   include profiles::icinga2_agent
   include profiles::cacert_boardvoting
 }
index 7bed9fd..3e77a4f 100644 (file)
@@ -24,6 +24,6 @@ class roles::proxyin {
   include profiles::base
   include profiles::rsyslog
   include profiles::sniproxy
-  include profiles::nrpe_agent
+  include profiles::purge_nrpe_agent
   include profiles::icinga2_agent
 }
index cf8f3a7..4faeb43 100644 (file)
@@ -24,6 +24,6 @@ class roles::proxyout {
   include profiles::base
   include profiles::squid
   include profiles::rsyslog
-  include profiles::nrpe_agent
+  include profiles::purge_nrpe_agent
   include profiles::icinga2_agent
 }
index 74f5986..d75caa9 100644 (file)
@@ -23,7 +23,7 @@
 class roles::puppetmaster {
   include profiles::base
   include profiles::rsyslog
-  include profiles::nrpe_agent
+  include profiles::purge_nrpe_agent
   include profiles::icinga2_agent
   include profiles::puppet_server
 }
index a34d7d6..2115c4c 100644 (file)
@@ -23,6 +23,6 @@
 class roles::svnserver {
   include profiles::base
   include profiles::rsyslog
-  include profiles::nrpe_agent
+  include profiles::purge_nrpe_agent
   include profiles::icinga2_agent
 }
index add209e..006dd6f 100644 (file)
@@ -23,7 +23,7 @@
 class roles::translations {
   include profiles::base
   include profiles::rsyslog
-  include profiles::nrpe_agent
+  include profiles::purge_nrpe_agent
   include profiles::icinga2_agent
   include profiles::pootle
 }
index f2697a6..99b019c 100644 (file)
@@ -23,6 +23,6 @@
 class roles::web {
   include profiles::base
   include profiles::rsyslog
-  include profiles::nrpe_agent
+  include profiles::purge_nrpe_agent
   include profiles::icinga2_agent
 }
index 40cc7bf..e4a8d8b 100644 (file)
@@ -23,6 +23,6 @@
 class roles::webstatic {
   include profiles::base
   include profiles::rsyslog
-  include profiles::nrpe_agent
+  include profiles::purge_nrpe_agent
   include profiles::icinga2_agent
 }