Hi,
in terms of nested dictionaries and arrays, the Director provides only a limited set of the Icinga 2 DSL. Which basically means that you need to use flattened values and cannot use advanced techniques shown in the Icinga 2 DSL examples with nested apply for loops and so on.
In terms of the question, let’s see about this - no Director pro, still learning myself. I’m using the Vagrant box standalone
which includes Director 1.6.0.
Template Inheritance
- Define a new data field
disks
as array
- Define the host template
windows-generic
, adddisks
as field, addC:
as values in the template
-
Add host
win-sql
, import thewindows-generic
template, and setdisks
as custom property toE:
-
Deploy the config and render it
Conclusion: Additive assignments for array lists are not supported in the interface.
Service Sets
So, I just sat down and remembered what I’ve tried a while ago with analyzing a problem in Icinga and the Director.
I do think that service sets exactly solve your requirement, but you need to try them out.
Since this got pretty long with many screenshots, I’ve moved it into the howto section. I guess this is one of best strategies inside the Director without much docs
Director Service Sets: Add service checks based on host templates
Conclusion
Try it out and see if that fits your problem. It requires a little change in your thinking and strategy.
I’ve written this at work, improving my Director skills once more and even getting direct Feedback from Tom.
Cheers,
Michael