I'm sure this is so simple I'm just not seeing it. I have an array of hashes of filenames & modes defined in hiera (the actual problem is a tad more complex, but for simplicity, if I can solve this, I can solve the bigger problem):
files:
- name: /etc/skel/.bashrc
mode: 600
- name: /etc/sysctl.conf
mode: 600
and so on.
I then have a class which loads this hash and wants to execute a defined type for it, basically enforcing the mode for each file:
define compliance::file {
file { "$title":
mode => ???
}
}
And that's where I'm stuck -- how on earth do I get at the "mode" value of the array of hashes? Is there an easier way to do this that allows me to add additional hash keys for various files later?
Thanks!