This sounds like a great use case for an additional parameter on ucdpuppet::kerberos::config, to allow a user to pass in a source location, with a sane default, or to use an ERB template in conjunction with at least one parameter to define the contents. The parameters could be defined in hiera, so there's no special if case in your code, just various data fed in based on your hierarchy.
On Thursday, April 28, 2016, Omen Wild <o...@ucdavis.edu> wrote: > I am looking for a way to pass "arguments" through multiple includes into > a subclass. Situation is like this: > > ----- Begin code ----- > node 'a-file-server.ucdavis.edu' { > include physicsnode > } > > class physicsnode { > include baseclass > > include ucdpuppet::kerberos > } > > class ucdpuppet::kerberos { > ... > include ucdpuppet::kerberos::config > ... > } > > class ucdpuppet::kerberos::params inherits ucdpuppet::params { > case $::osfamily { > 'Debian', 'RedHat' : { > $krb5_conf_path = '/etc/krb5.conf' > $krb5_keytab_path = '/etc/krb5.keytab' > } > } > ... > } > > class ucdpuppet::kerberos::config inherits ucdpuppet::kerberos::params { > file {$ucdpuppet::kerberos::params::krb5_conf_path : > source => 'puppet:///modules/ucdpuppet/kerberos/krb5.conf' > } > } > ----- End code ----- > > The problem is that a-file-server.ucdavis.edu is a special snowflake > and requires a different krb5.conf file. I could build that knowledge > into ucdpuppet::kerberos::params based on the fqdn, but burying the > info like that really bugs me. I would like some way to define that in > the node definition and be able to pull that out in > ucdpuppet::kerberos::config. > > Thanks, > Omen > > -- > Omen Wild > Systems Administrator > Metro Cluster > > -- > 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 <javascript:;>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/20160428200333.GA7428%40descolada.ucdavis.edu > . > For more options, visit https://groups.google.com/d/optout. > -- Rob Nelson rnels...@gmail.com -- 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/CAC76iT8CzHxu8u_FPmKaQAS2kts_BVAZgVTet-He4V0%2B6O2oaA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.