Re: [Puppet Users] Hash iteration order in a template not consistent

2014-02-24 Thread Andre Nathan
On Friday, February 21, 2014 10:15:01 AM UTC-3, Andre Nathan wrote: On Thursday, February 20, 2014 12:06:15 PM UTC-3, jcbollinger wrote: File a ticket if you wish, but personally, I'm inclined to say that *any*reliance on iteration order of a hash is dodgy. If iteration order matters

Re: [Puppet Users] Hash iteration order in a template not consistent

2014-02-24 Thread jcbollinger
On Friday, February 21, 2014 7:15:01 AM UTC-6, Andre Nathan wrote: On Thursday, February 20, 2014 12:06:15 PM UTC-3, jcbollinger wrote: File a ticket if you wish, but personally, I'm inclined to say that *any*reliance on iteration order of a hash is dodgy. If iteration order matters

Re: [Puppet Users] Hash iteration order in a template not consistent

2014-02-21 Thread Andre Nathan
On Thursday, February 20, 2014 12:06:15 PM UTC-3, jcbollinger wrote: File a ticket if you wish, but personally, I'm inclined to say that *any*reliance on iteration order of a hash is dodgy. If iteration order matters then you need to take proactive measures to ensure that you reliably get

Re: [Puppet Users] Hash iteration order in a template not consistent

2014-02-20 Thread jcbollinger
On Wednesday, February 19, 2014 1:47:35 PM UTC-6, Andre Nathan wrote: Hello Sorry to ressurect this old thread, but I've just found this issue upgrading from Puppet 2.7.x to Puppet 3. It's true that ruby 1.8 hash order cannot be relied on, but it should always be the same, right? I mean,

Re: [Puppet Users] Hash iteration order in a template not consistent

2014-02-19 Thread Andre Nathan
Hello Sorry to ressurect this old thread, but I've just found this issue upgrading from Puppet 2.7.x to Puppet 3. It's true that ruby 1.8 hash order cannot be relied on, but it should always be the same, right? I mean, one doesn't know which order the hash contents will be iterated on, but

Re: [Puppet Users] Hash iteration order in a template not consistent

2012-04-03 Thread Matthias Saou
On Thu, 29 Mar 2012 10:06:01 +0200 Martijn Grendelman mart...@iphion.nl wrote: [...] ruby hashes are not stored in predictable order so this will happen, the proposed solution should work. But as always the best is just to test it and see how it goes, it wont bite :) %

[Puppet Users] Hash iteration order in a template not consistent

2012-03-28 Thread Martijn Grendelman
Hi, I did some basic googling, but didn't find an answer yet. I am sorry if this is a FAQ. In a manifest for creating an Apache config file, I define a hash like this: $aliases = { '/foo/' = '/home/foo/www/', '/bar/' = '/home/bar/www/', '/baz/' =

Re: [Puppet Users] Hash iteration order in a template not consistent

2012-03-28 Thread R.I.Pienaar
- Original Message - From: Martijn Grendelman mart...@iphion.nl snip http://serverfault.com/questions/368784/puppet-and-templates-how-to-loop-sequently-and-not-randomly which suggests to do something like % aliases.sort_by {|key, value| key}.each_pair do |key, val| -%

Re: [Puppet Users] Hash iteration order in a template not consistent

2012-03-28 Thread Sergey Zhuga
Hi, I did it something like that: % aliases.sort.each do |alias| -% Alias %= alias.first % %= alias.last % % end -% Regards. Hi, I did some basic googling, but didn't find an answer yet. I am sorry if this is a FAQ. In a manifest for creating an Apache config file, I define a hash