Blacklisting not possible if using service sets in host templates

I added a service set to a host template to reduce the manual configuration.
The problem is, that when I try to blacklist one of the services from the service set on a host, the deployment will fail with the message:
critical/config: Error: object rule 'ignore where' cannot be used without 'assign where'
This is making the service set/blacklist feature useless or at least there is a lot more to configure (I would need to reconfigure about 200 servers only to remove this one servie on one server)

Infrastructure:
Icinga 2.10.5
Icinga Web 2.6.3
Director newest master

Hi,

within apply for, ignore where is allowed since there is a match within the for expression already. With single apply rules, you need to use an assign where expression.

That’s for the technical background. Now for the Director parts - can you share a screenshot of such a configuration?

Might also be a bug, since you’re using Git Master.

Cheers,
Michael

image
This is the part of the configuration, that was marked with an error.
The file is zones.d/...dmz/servicesets.conf, so it is not even the same zone as the server where I tried to blacklist the service.

I do not explicitly use an assign, instead I am applying the service set to a host template, maybe that is the problem (but that was my intuitive guess and it worked pretty well without any blacklisted objects)

You are looking for a structure like this:

apply Service "win_drive_c" {
   display_name = "Lok. Datenträger C:\\"
   check_command = ...
   assign where <your condition>
   ignore where host.name == "...win99..."
}

In general, I’d recommend to use simply names for objects (this will simply e.g. API calls etc.)

Instead of ignoring some hosts you may take host templates into account and assign service objects accordingly. Example:

assign where “Windows” in host.templates

That seems to be a wrong usage with blacklists then, not denied by the Director. A service object cannot use assign or ignore where expression. Like @rsx said, use apply instead of single objects then.

Hey Michael, were you able to get a work-around for Servicesets? I would REALLY like to reuse Servicesets and blacklist what I do not need to use per Host.

-Greg

1 Like

Looks like I stumbled over the same problem and can’t deploy until I clean this up.