Here's the problem: I have lots of server configuration files written in YAML, one file per server. There are a bunch of servers but actually only a few general types of them according to their respective main purpose (e.g. web servers, DNS servers, MySQL database servers, file servers, etc). However, some servers would be a little different from each other e.g. they have certain specific features turned on or off, etc. And of course each would have unique configuration items like IP address and hostname.
Now I would like to refactor these configuraion files, making them as, say, *.yamlt files where they can later be processed into the final *.yaml files.
The .yamlt file could contain normal YAML, or a reference/"use"/"include" statement followed by another .yaml/yamlt filename, optionally followed by a few specific differences. Sort of a parameterized templating, or inheritance templating, lacking a better terms. Basically for the config of a certain server I want to instruct, "use this type of server as a base, but turn feature A and B off, feature C on."
The YAML structure is a bit complex, sort of like a tree/registry, instead of a simple one-level hash.
Any idea how one might do this?
In reply to YAML + template/reuse by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |