Ordering of hiera_hash
I was looking into a way of producing a templated file entirely from hiera I have go this to work using a hiera_hash from the values in hiera and the template then looks like this:-
<% scope.function_hiera(["test_template_from_yaml", ]).each do |key,val| -%> <%= key %>=<%= val %> <% end -%>
The problem is that each time puppet is run the content of the file will change and the ordering of the values will shuffle. This could cause problems if the template will cause a service to restart.
Ideally I'd like the hiera_hash to be ordered the same way it is in the yaml file it is retrieved from. Is there anyway of ordering it like this - or some of other way?