El 12/03/2014 17:19, "Jonathan Proulx" <j...@jonproulx.com> escribió:
>
> see http://docs.puppetlabs.com/hiera/1/puppet.html
>
> "If you need to merge arrays or merge hashes from multiple hierarchy
> levels, you will have to use the hiera_array or hiera_hash functions
> in the body of your classes."
>
> There's not really a good example in that page, but essentially where
> 'hiera' takes the most specific patch hiera_array and heira_hash
> collect all the values across all matching hierarchies (though you
> needn't define the key in every level)
>
+1 it should be something like
common.yaml
users:
user1:
ensure: present
home: /home/user1
......
server1.yaml
users:
user3:
ensure: present
home: /home/user3
And then
$users= hiera_hash('users')
users::admin_homedir_define { $users: }
Note: code not tested
Regards
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CABZB-sgYSky1BzZ6Vf1OHuYonAhLh-gKV%2BN_RmiQreRyWbVk_w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAF_B3dcgKzCVPdEBSjEQ5y6cMR0soodHcETwJOhZnSdW4QCrNQ%40mail.gmail.com.
Try my code, its just what you want.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CA%2BnSE3-n54w0aYaGwt%2BrMj%2BiretvhOv%2BO43q6RGZ4GwCXo_QHg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAF_B3df73_1LiovbO4LWfvOzdicq2ACw5Q3XtBkG7O0S11sJ9w%40mail.gmail.com.