Cheers,
I have the situation that I want to apply a service to a host, but only for hosts that a certain service (with certain variables).
So essentially something like:
apply service "foo" { foreach service on host { assign where service.name = match(bar) and service.vars.baz = true } }
So if I had services
bar one
withvars.baz=true
,bar two
withvars.baz=false
andbar three
withbaz=true
, I’d get two services, one each forbar one
andbar three
.As I just noticed, I’d probably also need some way to get a unique service name derived from the conditional services.
Is it folly to go for it like this or should I just use variables for the host and derive all services from those?
Answer
Attribution
Source : Link , Question Author : towo , Answer Author : Community