Hi,
I have read about the known "feature" of ruby 1.8.7 not using the entered order for each_pair and using some random order instead, has anyone managed a work around for this that does not mean having to upgrade to 1.9.3
I have hiera data that looks something like this
my::variables:
"variable1":
comment: '# this is a variable comment'
value: '100'
"variable2":
comment: '# this is a variable comment'
value: '200'
"variable3":
comment: '# this is a variable comment'
value: '300'
in my template i have
<% @vars.sort.each_list do |varname, hash | -%>
<%= hash['comment'] %>
<%= varname %> = <%= hash['value'] %>
<% end -%>
i wanted them to come out like the following but they come out in a random order so nearly every puppet run could cause a change and restart a service
# this is a variable comment
variable1 = 100
# this is a variable comment
variable2 = 200
# this is a variable comment
variable3 = 300
any ideas
cheers
Simon