Opened 5 years ago

Closed 5 years ago

#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?)

Change History (4)

comment:1 Changed 5 years ago 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 5 years ago 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 5 years ago 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 5 years ago 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.

Note: See TracTickets for help on using tickets.