Hey there! Firstly this cookbook is insanely useful and has saved me much time by not reinventing the wheel, and I am greatly appreciative of that!
I've been scratching my head for a few days trying to get top down config sync working with icinga2_environment. Per the icinga2 docs it recommends placing each endpoint in its own zones.d/{zone} dir. When I use icinga2_environment you can only give it one zone:
icinga2_environment 'chef' do
environment 'prod'
enable_cluster_hostgroup false
enable_application_hostgroup false
enable_role_hostgroup false
check_command 'hostalive'
zone_parent 'master'
zone 'prod01'
end
Expected Behavior
I would expect a way to tell icinga2_environment to create a new zones.d/{zone} for every matched host in the provided environment similar to the icinga2 docs.
Current Behavior
icinga2_environment creates zones.d/prod01 with host/endpoint/zone objects. It also creates a zone object that encompasses all endpoints for the zone which icinga2 fails to load. Ex:
object Zone "host01.example.com" {
endpoints = [ "host01.example.com" ]
parent = "master"
}
object Zone "host02.example.com" {
endpoints = [ "host02.example.com" ]
parent = "master"
}
object Zone "host03.example.com" {
endpoints = [ "host03.example.com" ]
parent = "master"
}
object Zone "prod01" {
endpoints = ["host01.example.com", "host02.example.com", "host03.example.com"]
parent = "master"
}
Results in:
critical/config: Error: Endpoint 'host01.example.com' is in more than one zone.
Possible Solution
It's more than likely I am using icinga2_environment incorrectly or I am not supposed to use this resource for top down config sync. Regardless I found #38 which give me a glimmer of hope that it is somehow possible. However, after staring at provider_instance.rb for an hour I have accepted I am in over my head.
Context
I would like to apply top down config sync using icinga2_environment for my chef environments. We host 100s of individual hosts and top down config sync would be the easiest and less resource intense way to use icinga2.
Your Environment
Chef Version: 13.8.5
Hey there! Firstly this cookbook is insanely useful and has saved me much time by not reinventing the wheel, and I am greatly appreciative of that!
I've been scratching my head for a few days trying to get top down config sync working with
icinga2_environment. Per the icinga2 docs it recommends placing each endpoint in its ownzones.d/{zone}dir. When I useicinga2_environmentyou can only give it one zone:Expected Behavior
I would expect a way to tell
icinga2_environmentto create a newzones.d/{zone}for every matched host in the provided environment similar to the icinga2 docs.Current Behavior
icinga2_environmentcreateszones.d/prod01with host/endpoint/zone objects. It also creates a zone object that encompasses all endpoints for the zone which icinga2 fails to load. Ex:Results in:
Possible Solution
It's more than likely I am using
icinga2_environmentincorrectly or I am not supposed to use this resource for top down config sync. Regardless I found #38 which give me a glimmer of hope that it is somehow possible. However, after staring at provider_instance.rb for an hour I have accepted I am in over my head.Context
I would like to apply top down config sync using
icinga2_environmentfor my chef environments. We host 100s of individual hosts and top down config sync would be the easiest and less resource intense way to use icinga2.Your Environment
Chef Version: 13.8.5