I try to create dynamic hostgroups with apply rules which should use numeric custom host vars as selection criteria, but it does not work as expected. The var is created with datatype number, hosts contain values like 17.3 or 25. I want to put hosts into the group where val >= x and val < y.
It seems that director creates strings for vales x & y (delimited by " ") within apply rules and so the rules are not working. It also seems that the comparator <= or >= is not allowed (maybe caused by string comparisation).
The rules created look like this in preview:
assign where (host.vars.location in [ "loc1", "loc2"] && (match("server*", host.vars.host_type) || match("client*", host.vars.host_type))) || (match("client*", host.vars.host_type) && host.vars.building == "building1" && host.vars.floor > "2")
IMHO the problem are the quotation marks. I played around to convert imported data to numbers, but
I’ve found only a converter from string to integer, but not from string to float/double/…
Icinga version 2.11.2-1, Director master (snapshot from Oct. 2019)
Are there any restrictions or tricks?
Or is it a bug?