Hello,
How do you share common hiera values across multiple environments (e.g. staging, production, testing) using puppet with r10k?
And how do you deploy those defaults automatically?
I've got multiple projects defined in r10k, and each project have at least 3 environments - staging, production, testing. I would like to move common values (a lot of them) to separate file so I don't need to duplicate them.
At this moment I plan to create custom fact that returns same value for each environments, e.g. projname, add to **hiera.yaml**:
- "%{::environment}/hieradata/%{::fqdn}"
- "%{::environment}/hieradata/%{::hostname}"
- "%{::environment}/hieradata/role-%{::cluster_role}"
- "%{::environment}/hieradata/virtual-%{::is_virtual}"
- "%{::environment}/hieradata/common"
- "%{::projname}/hieradata/common"
And simply add projname as another branch in project git repository with hieradata.
**I'm not very satisfied with this solution, could you suggest anything better?**
Any help appreciated.
↧