On Tuesday, June 12, 2012 5:51:06 PM UTC-5, Wolf Noble wrote: > > Hi John, > > Thanks a bunch. This seems incredibly sensible. > > If I'm understanding your suggestion properly, I interpret the best thing > to do as something like: > > > mymodule::repos { > $region_repos = hiera('region_repos' , '' ) > $dc_repos = hiera('dc_repos' , '' ) > > if $region_repos { > create_resources('yumrepo', $region_repos)) > } > if $dc_repos { > create_resources('yumrepo', $dc_repos)) > } > #... > } > > and then I could override them like > > us-east/foo/qa/webservers/web02.qa.myfoo.com.yaml > > region_repos: "" > dc_repos: > foodc_qa_repo: { > descr: foodc-qa, > baseurl: http://myfoo.com/foodc-repo, > gpgkey: http://myfoo.com/foodcrepo/key, > gpgcheck: 1, > enabled: 1, > enablegroups: 0 > } > > > with the known caveat that I'd have to explicitly redeclare the entire > hash at the most relevant tier if I wanted to change any element of the > hash already defined. > > > Did I miss anything? >
I don't see any obvious errors or omissions. In particular, you are correct that overriding repos declared at a lower level will involve declaring an entirely new hash (of hashes) at the appropriate higher level. That's one of the costs attending complex data. All in all, it looks nicely fleshed out. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Ts3RcypLci0J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.