Hi Raghu, Yes this is possible. Your example looks workable, but don't forget to add commas after the values of the hash.
Check out Puppet's 'reduce' function, it iterates over data and allows you to return a new structure after all the iteration which could be your new hash. Alternatively it might be worth writing something in Ruby if Puppet's immutable variables get in the way which may happen if you're heavily modifying your hash. On Thu, 27 Aug 2020, 3:45 am Raghu Ram Baisani, <baisaniraghu...@gmail.com> wrote: > Hi Guys > > Some one help me solving this issue. > *Example:* > [ > { > name => raghuram, > age => 22 > }, > { > name => vinay > age => 25 > } > ] > the idea is to iterate through an existing hash and create new hash with > some modifications and add it to array. > Thanks in advance > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/32ee1353-0cd3-47fa-af66-c3ef976dcdean%40googlegroups.com > <https://groups.google.com/d/msgid/puppet-users/32ee1353-0cd3-47fa-af66-c3ef976dcdean%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CABaapwJ2geR_--STyK-CUc1OpUzK8zw3uPrBgHN2D%2BfswGPH%2BA%40mail.gmail.com.