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

Bugfix: don't fail if more than one environment is given in query_objects and allow to collect from all environments #724

Closed sircubbi closed 1 year ago

sircubbi commented 1 year ago

This fix allows to properly specify more than one environment in icinga2::query_objects and also allows to not specify an environment at all, to collect all objects from all existing environments.

Previously a definition like

icinga2::query_objects::environments:
  - 'production'
  - 'development'

results in the following error:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, unexpected token at 'PQL parse error at line 1, column 53:

resources[parameters] { environment in ['production'development'] and type = 'Icinga2::Object' and ....
sircubbi commented 1 year ago

I created two different PRs (#724 and #725), because both address separate issues. Since you cannot merge both of them together, I will rebase once one of the both PRs have been accepted.