Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: YAML + template/reuse
by moritz (Cardinal) on Nov 30, 2007 at 14:16 UTC | |
by Anonymous Monk on Nov 30, 2007 at 14:21 UTC | |
by Anonymous Monk on Dec 01, 2007 at 02:11 UTC | |
|
Re: YAML + template/reuse
by clinton (Priest) on Dec 01, 2007 at 16:54 UTC | |
|
Re: YAML + template/reuse
by locked_user sundialsvc4 (Abbot) on Nov 30, 2007 at 16:40 UTC | |
|
Re: YAML + template/reuse
by Anonymous Monk on Nov 30, 2007 at 14:18 UTC |