-
i am trying to sort an array of hashes by a specific key of the hashes. in my case i have firewall rules which should be sorted by the googling leads to the
with erb it is no problem as i can use
but because of the missing environment isolation of erb templates i would like to know how to do this with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
you can use the following in puppet >= 6 or with puppetlabs-stdlib [{'order' => 1}, {'order' => 3}, {'order' => 2}].sort |$a, $b| { compare($a['order'], $b['order']) } |
Beta Was this translation helpful? Give feedback.
you can use the following in puppet >= 6 or with puppetlabs-stdlib