I have a custom puppet module for setting up Apache web server and I use templates to copy the configurations. We have different environments like production, Quality Assurance, Integration testing.
Each environment has one or more servers. The template uses variables based on these environments, and this ensures usage of same template file across all environments instead of using different environment specif files
So far i came to know that we can use {environment}.yaml type files in heira, which I don't prefer since I don't want to maintain two set of files for the environments like production.yaml and qa.yaml
What is the best practice to achieve this scenario?
- My view is that we assign environments of host in /etc/puppet/manifest/site.pp
- Where should we maintain environment specific variables (like domain=mysite.qa.example.com). Is this packaged in facts inside the module based on environment from site.pp for the node or is it maintained as node specific config in /etc/facter/facts.d/ on every node?
Is there a working example for the above.