icinga2 node wizard🧙‍♂️ creates 2 zones, despite Local zone == Parent zone
Is your feature request related to a problem? Please describe.
If I specify equal names for Local zone name and Parent zone name, icinga2 node wizard creates both zones with identical names as I specified.
Local zone name [master2]: master
Parent zone name [master]:
Default global zones: global-templates director-global
Do you want to specify additional global zones? [y/N]:
Do you want to disable the inclusion of the conf.d directory [Y/n]:
Disabling the inclusion of the conf.d directory...
Done.
Now restart your Icinga 2 daemon to finish the installation!
[root@aklimov820479-2 ~]# cat /etc/icinga2/zones.conf
/*
* Generated by Icinga 2 node setup commands
* on 2024-12-11 10:39:26 +0000
*/
object Endpoint "master1" {
host = "10.27.2.188"
port = "5665"
}
object Zone "master" {
endpoints = [ "master1" ]
}
object Endpoint "master2" {
}
object Zone "master" {
endpoints = [ "master2" ]
parent = "master"
}
object Zone "global-templates" {
global = true
}
object Zone "director-global" {
global = true
}
[root@aklimov820479-2 ~]#
Describe the solution you'd like
Create just one zone.
Describe alternatives you've considered
Reject such input explicitly.
I'd like to take a look at this
this issue is not solved yet ,so can you please assign it to me
If I specify equal names for Local zone name and Parent zone name
Can you please describe the use-case where you want to do that?
I think this is useful for secondary master enrollment without having to manually editing the config
If that's the case, isn't the whole flow broken? Before all of that, it asks the following:
Please specify if this is an agent/satellite setup ('n' installs a master setup) [Y/n]:
So if you'd want to install a second master, you'd have to claim you don't want to install a master but then say the same for local and parent zone name? That doesn't sound right.
But it's the way of least disruption if you don't want to edit the zone config immediately after generating it with Icinga itself.
And yes, in this case you don't want to install THAT kind of master. (With ca.key and possibly exclusive config authority.)
I agree that the flow is broken too.
All Icinga books say "for a secondary master enroll as satellite/ agent and change config"
but fixing that would fix it in node setup command which is not aware of agent or master install
here is the forum topic that brought me here with a better explanation https://community.icinga.com/t/icinga2-master-enrollment-by-cli/15428
Exactly @Al2Klimov . Additionally, doing this right now outputs an invalid config with duplicate zone definitions (where one parents itself) which completely prevents Icinga from starting. This change makes it generate a single, valid zone containing both endpoints instead.
Yep. It's definitely more natural to merge the two master zones into one, as #10969 does, than status quo.
So if you'd want to install a second master, you'd have to claim you don't want to install a master
You don't necessarily want to install a second master.
You might also want to install a second satellite. For this, you could specify your existing satellite as "master", thanks to the CA proxy, and your own zone as the same satellite zone. Now "this is an agent/satellite setup" makes complete sense.
Hey ,just wanted to ask when my pr got merge?
@julianbrost What about this?
Please specify if this is a primary/secondary master setup ('n' installs an agent/satellite setup) [1/2/n]:
Hey ,just wanted to ask when my pr got merge?
Unclear at this time, It's just that this issue wasn't really thought through that well, sorry about that.
@julianbrost What about this?
Please specify if this is a primary/secondary master setup ('n' installs an agent/satellite setup) [1/2/n]:
And then? I mean it would be the nicest if all scenarios of setting up a new master/satellite, joining a master/satellite zone as a second node, and setting up an agent would work and and in particular work by giving the obvious answers to questions. So now the big question is how much rework would this need? But in the end, this would give the far better and more user-friendly behavior.
And then "2" would behave just like "n", except there's only one zone (asked for).
I personally would just take #10969, an obviously natural quick fix w/o collateral damages. But you don't like it, so I'm suggesting alternatives.
I personally would just take #10969, an obviously natural quick fix w/o collateral damages.
Well I don't think it would do harm, but that shouldn't be our benchmark here. I don't think it's much of an improvement if you need to employ some counter-intuitive undocumented wizardry (pun intended) to make use of it.