Merge lp:~wesmason/charms/trusty/elasticsearch/fix-nrpe-hook into lp:charms/trusty/elasticsearch

Proposed by Wes Mason
Status: Merged
Approved by: Wes Mason
Approved revision: 36
Merged at revision: 37
Proposed branch: lp:~wesmason/charms/trusty/elasticsearch/fix-nrpe-hook
Merge into: lp:charms/trusty/elasticsearch
Diff against target: 11 lines (+1/-0)
1 file modified
roles/nrpe/tasks/main.yml (+1/-0)
To merge this branch: bzr merge lp:~wesmason/charms/trusty/elasticsearch/fix-nrpe-hook
Reviewer Review Type Date Requested Status
Simon Davy (community) Approve
charmers Pending
Review via email: mp+270395@code.launchpad.net

Commit message

Fix error when nrpe-external-master-relation-changed hook fires without nagios_hostname being present

Description of the change

This is a fix for a race condition [1] occurring with the latest nrpe subordinate in which the nrpe-external-master-relation-changed hook is fired without nagios_hostname set in the relation payload, and so the playbook errors having tried to use it. I've included a simple "when" condition to ensure the "nagios_hostname" key is in current_relation.

[1] http://paste.ubuntu.com/12313599/

To post a comment you must log in.
Revision history for this message
Simon Davy (bloodearnest) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'roles/nrpe/tasks/main.yml'
2--- roles/nrpe/tasks/main.yml 2014-04-08 13:25:50 +0000
3+++ roles/nrpe/tasks/main.yml 2015-09-08 12:48:41 +0000
4@@ -17,6 +17,7 @@
5 owner: nagios
6 group: nagios
7 mode: 0644
8+ when: 'nagios_hostname' in current_relation
9
10 - name: Trigger nrpe-external-master-relation-changed to restart.
11 tags:

Subscribers

People subscribed via source and target branches