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

Regression with query_objects on 4.0.0 #739

Closed sircubbi closed 1 year ago

sircubbi commented 1 year ago

4.0.0 breaks icinga2::query_objects as suddenly all files are written with base64-content

Expected Behavior

No changes should occur in the way all configuration files are written.

Current Behavior

Notice: /Stage[main]/Icinga2::Query_objects/Concat[/etc/icinga2/zones.d/rocky9eval.relaix.net/host.conf]/File[/etc/icinga2/zones.d/rocky9eval.relaix.net/host.conf]/content: 
--- /etc/icinga2/zones.d/rocky9eval.relaix.net/host.conf    2023-09-06 12:16:21.647787380 +0200
+++ /tmp/puppet-file20230909-3878990-jmrpsi 2023-09-09 12:02:44.357339767 +0200
@@ -1,112 +1,2 @@
 # This file is managed by Puppet. DO NOT EDIT.
-
-
-object Host "rocky9eval.relaix.net" {
-  import "generic-puppet-host"
[...]
-  zone = ZoneName
-  address = "46.183.100.56"
-  address6 = "2a00:fe0:0:5::5600"
-}
+Cm9iamVjdCBIb3N0ICJyb2NreTlldmFsLnJlbGFpeC5 [...] XQiCn0K
\ No newline at end of file

Notice: /Stage[main]/Icinga2::Query_objects/Concat[/etc/icinga2/zones.d/rocky9eval.relaix.net/host.conf]/File[/etc/icinga2/zones.d/rocky9eval.relaix.net/host.conf]/content: current_value '{sha256}8ccc29ec3bd64d18baf50e448cd6d70f3244d3b6ea08131f0a933afccf8efa91', should be '{sha256}55f6cbece42bda2bae0c74771d8e51945a8d265d11603c43b955fe56d5d07495' (noop)

Possible Solution

Not sure why this breakes, but it seems that on some instance the icinga2::config::fragment is stored in base64-format and not properly reconverted to ascii.

Your Environment

lbetz commented 1 year ago

What? Works quit nice for a customer weeks ago, but on Puppet 7.

sircubbi commented 1 year ago

Hmmm, that is strange. I cannot really find any kind of reference to base64, so not sure where this is coming from. Also not sure if it is stored in the puppetdb as base64, or only gets converted once it is pulled out. That however should be easy to test.

sircubbi commented 1 year ago

Actually just a bit of googling seems to point that this is actually indeed an issue with Puppet 8.

https://github.com/puppetlabs/puppet/pull/9102 https://github.com/voxpupuli/puppet-bacula/issues/189

lbetz commented 1 year ago

I unfortunately don't have a Puppet 8 environment here right now to try a workaraound.

sircubbi commented 1 year ago

Not really sure if there can be a proper workaround, since it seems to be fixed in the puppetlib itself. Maybe just putting in a warning for the moment? I will at least wait a couple of days to see what happens in the issue mentioned above.

sircubbi commented 1 year ago

That issue should be fixed with Puppet 8.3.

I will close that issue here and wait with the update till that new puppet version surfaces.

lbetz commented 1 year ago

thx.

sircubbi commented 1 year ago

Just to confirm here (in any case somebody stumbles over this issue): the problem is fixed with puppet 8.3.1. Everything works as expected for us now.