Alexandros Kosiaris has submitted this change and it was merged.

Change subject: icinga: Parameterize icinga class to not notify
......................................................................


icinga: Parameterize icinga class to not notify

This should allow us to set up the new hosts without a flurry of
notifications from these. Put it in place for tegmen and einsteinium in
the same patch

Change-Id: Ibb18a8f8b12ab6a00ab3125e1ec49a12689ca309
---
A hieradata/hosts/einsteinium.yaml
A hieradata/hosts/tegmen.yaml
M modules/icinga/manifests/init.pp
R modules/icinga/templates/icinga.cfg.erb
4 files changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Alexandros Kosiaris: Verified; Looks good to me, approved



diff --git a/hieradata/hosts/einsteinium.yaml b/hieradata/hosts/einsteinium.yaml
new file mode 100644
index 0000000..8e07a84
--- /dev/null
+++ b/hieradata/hosts/einsteinium.yaml
@@ -0,0 +1 @@
+icinga::enable_notifications: 0
diff --git a/hieradata/hosts/tegmen.yaml b/hieradata/hosts/tegmen.yaml
new file mode 100644
index 0000000..8e07a84
--- /dev/null
+++ b/hieradata/hosts/tegmen.yaml
@@ -0,0 +1 @@
+icinga::enable_notifications: 0
diff --git a/modules/icinga/manifests/init.pp b/modules/icinga/manifests/init.pp
index 099fc6e..6561e89 100644
--- a/modules/icinga/manifests/init.pp
+++ b/modules/icinga/manifests/init.pp
@@ -4,7 +4,7 @@
 # FIXME: A lot of code in here (init script, user setup, logrotate,
 # and others) should probably come from the icinga deb package,
 # and not from puppet. Investigate and potentially fix this.
-class icinga {
+class icinga($enable_notifications=1) {
     # Setup icinga user
     # FIXME: This should be done by the package
     include icinga::group
@@ -54,7 +54,7 @@
     }
 
     file { '/etc/icinga/icinga.cfg':
-        source  => 'puppet:///modules/icinga/icinga.cfg',
+        content => template('icinga/icinga.cfg.erb'),
         owner   => 'icinga',
         group   => 'icinga',
         mode    => '0644',
diff --git a/modules/icinga/files/icinga.cfg 
b/modules/icinga/templates/icinga.cfg.erb
similarity index 99%
rename from modules/icinga/files/icinga.cfg
rename to modules/icinga/templates/icinga.cfg.erb
index 913e8bf..c56da62 100644
--- a/modules/icinga/files/icinga.cfg
+++ b/modules/icinga/templates/icinga.cfg.erb
@@ -849,7 +849,7 @@
 # service notifications when it is initially (re)started.
 # Values: 1 = enable notifications, 0 = disable notifications
 
-enable_notifications=1
+enable_notifications=<%= @enable_notifications %>
 
 
 

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

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

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

Reply via email to