Structuring configuration data in a hierarchy
In the previous section, we reduced the data problem to a simple need for key/value pairs that are specific to each node under Puppet management. Puppet and its manifests then serve as the engine that generates actual configuration from these minimalistic bits of information.
A simplistic approach to this problem is an ini
style configuration file that has a section for each node that sets values for all configurable keys. Shared values will be declared in one or more general sections:
[mysql] buffer_pool=15G log_file_size=500M ... [xndp12-sql01.example.net] psk=xneFGl%23ndfAWLN34a0t9w30.zges4 server_id=1
Rails applications customarily do something similar and store their configuration in a YAML format. The user can define different environments, such as production
, staging
, and testing
. The values that are defined per environment override the global setting values.
This is quite close to the type of hierarchical configuration that Puppet allows...