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

Error with custom fact icinga2_version for older versions of Icinga 2 #718

Closed misaflo closed 1 year ago

misaflo commented 1 year ago

Expected Behavior

No error with custom fact icinga2_version

Current Behavior

On Rocky Linux 8.7 since puppet-icinga2 3.5, I have this error:

Error: Facter: Error while resolving custom fact fact='icinga2_version', resolution='<anonymous>': undefined method `[]' for nil:NilClass

Your Environment

lbetz commented 1 year ago

Hi,

I am using a puppet server 7.20.0 and a Rocky 8.6 in my environment, I haven't problems. I get the following on my rocky based agent: $ facter -p icinga2_version 2.13.6

misaflo commented 1 year ago

The version differ in Rocky Linux.

In Debian, I have the release version with 'r':

sudo icinga2 -V | grep '(version: '
icinga2 - The Icinga 2 network monitoring daemon (version: r2.13.5-1)

In Rocky, I have not the 'r':

sudo icinga2 -V | grep '(version: '
icinga2 - The Icinga 2 network monitoring daemon (version: 2.13.2-1)

Icinga 2.13.2 is the latest available in the repo for CentOS 8.

So the icinga2 -V|grep 'version: r' in lib/facter/icinga2_version.rb does not works

lbetz commented 1 year ago

Strange, I think ist an Icinga version problem.... ok, so r has to be handle separately. For Enterprise Linux, Icinga only serves the current (newer than 2.13.2) packages via a supcription, see https://icinga.com/subscription/

lbetz commented 1 year ago

Also unit tests have to be done.