Personally I try to avoid putting hiera calls in manifests since this can 
make debugging significantly harder not to mention potentially clouding the 
intent of that module/class. I prefer exposing the data needs of a module 
via its API (i.e. class parameters) which also helps to make its intent 
clear along with providing [controlled] flexibility for the caller. In most 
cases automatic parameter binding (to hiera) will mean that you can retain 
the benefits of idempotent include. The one exception I allow is in a 
'profile' class (when using the popular 'roles and profiles' pattern) since 
its job is to coordinate the execution of the modules below satisfying 
their data needs as required. ... but YMMV

On Thursday, 7 January 2016 06:35:51 UTC, Johan De Wit wrote:
>
> Hi,
>
>
> Have a look at 
> https://docs.puppetlabs.com/hiera/latest/lookup_types.html#array-merge
>
>
> You do have to do explicit hiera calls in your manifests.
>
>
> Also a litlle remark about your hieradata :  best practice is to put 
> common.yaml as last.  
>
>
> Grts
>
>
> Johan
>
>
> -----Original message-----
> *From:* Albert Shih <alber...@obspm.fr <javascript:>>
> *Sent:* Wednesday 6th January 2016 23:11
> *To:* puppet...@googlegroups.com <javascript:>
> *Subject:* [Puppet Users] hieradata in add mode
>
> Hi,
>
> I'm asking something maybe stupid but well...
>
> I've got a
>
>   hieradata
>     - common.yaml
>     - hostname.yaml
>
> I would like to have in common.yaml
>
>   users_list :
>     - user1 user1_ssh_key
>     - user2 user2_ssh_key
>     - user3 user3_ssh_key
>
> and in someway I would like to add some users in
>
>   hostname.yaml
>
> so something like
>
>   users_list"+":
>     - user4 user4_ssh_key
>     - user5 user5_ssh_key
>
> The purpose is to add some users for specific host, but always keep some
> basic users.
>
> Regards.
>
> JAS
>
> --
> Albert SHIH
> DIO bâtiment 15
> Observatoire de Paris
> 5 Place Jules Janssen
> 92195 Meudon Cedex
> France
> Téléphone : +33 1 45 07 76 26/+33 6 86 69 95 71
> xmpp: j...@obspm.fr <javascript:>
> Heure local/Local time:
> mer 6 jan 2016 23:00:37 CET
>
> -- 
> 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...@googlegroups.com <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/20160106220924.GA26535%40pcjas.obspm.fr.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
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/9d6d76e7-75fb-4095-8dc1-e290dc606279%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to