Dzahn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/352731 )

Change subject: icinga: add another contact, use local var in .erb
......................................................................

icinga: add another contact, use local var in .erb

Use a local variable in the .erb template to avoid repeating
the same string multiple times.

Add a second contact to confirm the Hiera structure is found.

Change-Id: Ia2df8526ec7e7c90dc1b362595f0d188924a690e
---
M modules/nagios_common/templates/contacts-new.cfg.erb
1 file changed, 20 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/31/352731/1

diff --git a/modules/nagios_common/templates/contacts-new.cfg.erb 
b/modules/nagios_common/templates/contacts-new.cfg.erb
index 231be6d..87223bb 100644
--- a/modules/nagios_common/templates/contacts-new.cfg.erb
+++ b/modules/nagios_common/templates/contacts-new.cfg.erb
@@ -24,16 +24,32 @@
         service_notification_commands   notify-service-by-irc-wikidata
 }
 
+<% contact = dzahn %>
 define contact{
-        contact_name                    dzahn
+        contact_name                    <%= contact %>
         alias                           daniel_zahn
         host_notification_period        PST_awake_hours
         service_notification_period     PST_awake_hours
         host_notification_options       d,r,f
         service_notification_options    c,r,f
-        email                           <%= 
scope.function_hiera(['icinga_contacts_dzahn_email']) %>
-        pager                           <%= 
scope.function_hiera(['icinga_contacts_dzahn_pager']) %>
-        address1                        <%= 
scope.function_hiera(['icinga_contacts_dzahn_address1']) %>
+        email                           <%= 
scope.function_hiera(['icinga::contacts::${contact}::email']) %>
+        pager                           <%= 
scope.function_hiera(['icinga::contacts::${contact}::pager']) %>
+        address1                        <%= 
scope.function_hiera(['icinga::contacts::${contact}::address1']) %>
+        host_notification_commands      
host-notify-by-email,host-notify-by-sms-gateway
+        service_notification_commands   notify-by-email,notify-by-sms-gateway
+}
+
+<% contact = bblack %>
+define contact{
+        contact_name                    <%= contact %>
+        alias                           Brandon Black
+        host_notification_period        24x7
+        service_notification_period     24x7
+        host_notification_options       d,r,f
+        service_notification_options    c,r,f
+        email                           <%= 
scope.function_hiera(['icinga::contacts::${contact}::email']) %>
+        pager                           <%= 
scope.function_hiera(['icinga::contacts::${contact}::pager']) %>
+        address1                        <%= 
scope.function_hiera(['icinga::contacts::${contact}::address1']) %>
         host_notification_commands      
host-notify-by-email,host-notify-by-sms-gateway
         service_notification_commands   notify-by-email,notify-by-sms-gateway
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2df8526ec7e7c90dc1b362595f0d188924a690e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <dz...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to