Dzahn has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/372205 )

Change subject: librenms: no https/cert monitoring on inactive server
......................................................................


librenms: no https/cert monitoring on inactive server

Only add Icinga monitoring of the Letsecnrypt cert expiry
and https connection if on the active server.

Avoid on the inactive server. Add parameter $active_server
to librenms::web class as it already exists in the main class
, using a value from Hiera.

Bug: T172712
Change-Id: Iaa48de80affb62068d8c19d899390190baf36f34
---
M modules/librenms/manifests/web.pp
M modules/role/manifests/librenms.pp
2 files changed, 13 insertions(+), 3 deletions(-)

Approvals:
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/modules/librenms/manifests/web.pp 
b/modules/librenms/manifests/web.pp
index 4df630a..9fb2b44 100644
--- a/modules/librenms/manifests/web.pp
+++ b/modules/librenms/manifests/web.pp
@@ -1,6 +1,7 @@
 class librenms::web(
     $sitename,
     $install_dir,
+    $active_server,
 ) {
 
     if os_version('debian >= stretch') {
@@ -26,12 +27,20 @@
         require    => Class['apache::mod::ssl'],
     }
 
+    if $active_server == $::fqdn {
+        $monitoring_ensure = 'present'
+    } else {
+        $monitoring_ensure = 'absent'
+    }
+
     monitoring::service { 'https':
+        ensure        => $monitoring_ensure,
         description   => 'HTTPS',
         check_command => 'check_ssl_http_letsencrypt!librenms.wikimedia.org',
     }
 
     monitoring::service { 'librenms':
+        ensure        => $monitoring_ensure,
         description   => 'LibreNMS HTTPS',
         check_command => "check_https_url!${sitename}!http://${sitename}";,
     }
diff --git a/modules/role/manifests/librenms.pp 
b/modules/role/manifests/librenms.pp
index 84539fe..56164c6 100644
--- a/modules/role/manifests/librenms.pp
+++ b/modules/role/manifests/librenms.pp
@@ -137,9 +137,10 @@
     }
 
     class { '::librenms::web':
-        sitename    => $sitename,
-        install_dir => $install_dir,
-        require     => Class['::librenms'],
+        sitename      => $sitename,
+        install_dir   => $install_dir,
+        require       => Class['::librenms'],
+        active_server => $active_server,
     }
 
     ferm::service { 'librenms-rsyslog':

-- 
To view, visit https://gerrit.wikimedia.org/r/372205
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaa48de80affb62068d8c19d899390190baf36f34
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <[email protected]>
Gerrit-Reviewer: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: RobH <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to