I'm running puppet 4 and I would like to generate several config files from the same template with different configurations for each one.
for example :
# cat /tmp/a.conf
test1
# cat /tmp/b.conf
test2
And I need to put all those informations in hiera, so something like that I think :
test::clusters:
- 'a.conf'
text: 'test1'
- 'b.conf'
text: 'test2'
Thx
You need a defined type
in templates/test/clusters
Then you can define a
test::clisters
in a manifest like so:Or if you still wish to use hiera, you can use create_resources
Ok I find how to make it works :
Here is my hiera data/common.yaml :
Here is my module configuration manifests/init.pp :
The only thing I don't understand is why this is working :
And that doesn't work :