On Thu, Aug 11, 2016 at 11:53 PM, Michael Friedrich
<michael.friedr...@netways.de> wrote:
> That as such won’t work since the custom attributes values are computed at 
> config compile time. You are looking for runtime calculated values - which is 
> why you need to turn the custom attribute values into a function.
>
> Something like that:
>
> vars.cluster_label = {{ get_host("vagrant-minion").state }}
> vars.cluster_data =  {{ get_host("vagrant-minion").state }}
>

Ah, got it! This works. Thanks so much for the clarification.

Now I'm running into a new challenge. I would like to construct an
array of hostnames and then reference this array inside a service
object, as follows:

vars.elb["x"] = [ "xx.ap-northeast-1.compute.amazonaws.com" ,
"xy.ap-northeast-1.compute.amazonaws.com" ]

apply Service "clusterx" {
....
if (!vars.elb["x"] { log("Array not defined") }
...
}

The log statement shows me that this array is not defined in the
service definition. What am I doing wrong?
_______________________________________________
icinga-users mailing list
icinga-users@lists.icinga.org
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to