voxpupuli / puppet-icinga2

Puppet module to manage Icinga 2
https://forge.puppet.com/icinga/icinga2
Apache License 2.0
61 stars 94 forks source link

icinga2::object::* do not require class icinga2::globals to proper compile EPP templates #759

Closed cruelsmith closed 7 months ago

cruelsmith commented 7 months ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

Use only icinga2::object::host define on an node without any other icinga2 define an class calls.

What are you seeing

Puppet catalog compile fails for that node.

What behaviour did you expect instead

Puppet catalog compile and icinga2 host will be exported.

Output log

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, concat(): Requires array to work with (file: /etc/puppetlabs/code/environments/<redacted>/modules/icinga2/functions/parse.pp, line: 30, column: 5) (file: /etc/puppetlabs/code/environments/<redacted>/modules/<redacted>/manifests/profile/icinga/export_host.pp, line: 108) on node <redacted>

Any additional information you'd like to impart

The icinga2::object::* uses an EPP which calls the icinga2::parse function which requires access to the icinga2::globals::reserved. The issue is that icinga2::globals has not included before which then results in an Undef instead of Array and concat refuse to merge the values.

Issue was introduced with 4.0.0 (e3fe54114ccaaf73ce87990d4535622b80b2b9e4)

lbetz commented 7 months ago

refs #760