My issue is similar to the one found here:
I set up Icinga2 on a master server, together with the icingaweb2 and the database.
II have two zones. which are assigned based on a puppet variable on deployment / import with the director.
When I deploy the config, it fails with the following error message:
[2024-06-17 12:16:21 +0200] information/cli: Icinga application loader (version: r2.14.2-1)
[2024-06-17 12:16:21 +0200] information/cli: Loading configuration file(s).
[2024-06-17 12:16:21 +0200] critical/config: Error: Object '<master-host>' of type 'Host' re-defined: in [stage]/zones.d/dmz/hosts.conf: 2418:1-2418:46; previous definition: in /etc/icinga2/conf.d/hosts.conf: 18:1-18:20
Location: in [stage]/zones.d/dmz/hosts.conf: 2418:1-2418:46
[stage]/zones.d/dmz/hosts.conf(2416): }
[stage]/zones.d/dmz/hosts.conf(2417):
[stage]/zones.d/dmz/hosts.conf(2418): object Host "<master-host>" {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[stage]/zones.d/dmz/hosts.conf(2419): import "<template>"
[stage]/zones.d/dmz/hosts.conf(2420):
[2024-06-17 12:16:21 +0200] critical/cli: Config validation failed. Re-run with 'icinga2 daemon -C' after fixing the config.
If I delete the Icinga2 master host object in the director after the syncronization from puppetdb, the import run works perfectly and I can see my hosts and monitor them in Icingaweb2.
But every time I deploy a new config, I have to manually import everything and deploy it by hand because the config deployment will fail if I donât delete the imported master host.
This is pretty annoying as I cannot automate import, sync and deployment. Also, all of my configured services arenât deployed on the master.
I see the master as it is by default shown in icingaweb2 as it is the server host.
The solution of the cited post does not work, just setting the problematic host to no agent does not make the import run without issue (which would be nice because it would allow me to just assign another template to the host on sync with puppet).
My question is:
Can I delete the original master host in some way and just deploy it by standard means of the director as a âforeignâ host (meaing itâs not 127.0.0.1)?