Opened on 03/17/2015 at 04:50:20 PM

Closed on 03/18/2015 at 04:47:06 PM

#2160 closed defect (fixed)

Re-provisioning Nagios hostgroups is broken

Reported by: matze Assignee: matze
Priority: P1 Milestone:
Module: Infrastructure Keywords:
Cc: fhd, trev Blocked By:
Blocking: Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working:
Review URL(s):

http://codereview.adblockplus.org/6304894776508416

Description

Although the roll-out of #112 has succeeded, subsequent runs of kick.py for server_4 currently fail due to Puppet not being able to parse the local, existing hostgroups.cfg:

==> server4: err: Could not prefetch nagios_hostgroup provider 'naginator': Could not parse configuration for nagios_hostgroup: line 3: syntax error at '

The reason are obviously the empty member properties in hiera/roles/monitoringserver.yaml. Strangely this never occurred during development and test, although we've explicitly tested multiple deploys before.

(Maybe a Puppet minor- and patch-version update is enough here?)

Attachments (0)

Change History (4)

comment:1 Changed on 03/17/2015 at 05:04:04 PM by matze

After digging a bit deeper, I can confirm that this is actually caused by two bugs in Puppet:

  • As expected, Puppet parses the Nagios setup internally - but not always in the same fashion as Nagios does that itself. The latter, however, seems to have no issue with the configuration.
  • In addition, Puppet creates an empty member directive in hostgroups.cfg even when omitting this very parameter in the nagios_hostgroup() invocation (although it's optional!) and thus creates it's own pitfall.

Workaround for now: Manually delete the empty directive prior to an update. This is, of course, a very short term solution. In consequence, this ticket remains P1 and I'll try to find a solution rather quickly.

comment:2 Changed on 03/17/2015 at 05:59:52 PM by matze

After trying multiple versions of Puppet, this seems to be a re-occurring regression within Puppet. I've tried multiple versions (from the 2.* line), and it's virtually random whether the issue occurs or not. Yet the behavior is consistent when sticking to a particular one.

Also, I haven't found any simple workaround, like e.g. omitting the members in YAML, using an empty string or null as value, etc. So this won't be a one-liner..

comment:3 Changed on 03/17/2015 at 06:44:32 PM by matze

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

I've published a workaround for review. It's based on sed(1) and not very beautiful, but pretty lightweight..

comment:4 Changed on 03/18/2015 at 04:47:06 PM by matze

  • Resolution set to fixed
  • Status changed from reviewing to closed

After pushing and testing an even simpler workaround for this Puppet issue, I can now confirm that subsequent provisioning works as expected.

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from matze.
 
Note: See TracTickets for help on using tickets.