I am trying to create the same hierarchy that ansible provides with regard to host and group variables. Basically, key/values that are listed in group or global files are overwritten if the same pairs are listed in host files.
Has anyone done this yet? I have a feeling it’s a fairly common challenge for those trying to replace ansible for network config management. I’m running mostly Juniper devices, so I’ve been organizing the YAML files based on certain sections, e.g. system, interfaces, etc. Is there a better way to organize this data?
So far, I’ve been playing with dictionaries and trying to update keys using update() sequentially (global -> group -> host, where host variables override all). There are certain keys that I don’t want to override and instead iterate through the next level, which at this point is kinda over my head. I feel like I’m making this harder than it needs to be, but any guidance is definitely appreciated!