Quoting jcbollinger <[email protected]> on Fri, Apr 29 06:27:
>
> This sort of thing is Hiera's bread & butter.  

Awesome, and the second recommendation for Hiera. We're already using Hiera
for other stuff (mostly defining users and groups) so this should be a
pretty small addition.

Thanks for the detailed write-up, makes the implementation look pretty
straight forward.

> That would be a home run if you were already using parameterized
> classes and automated data binding,

I have a fairly extensive programming and sysadmin background, but am
still relatively new to Puppet. I inherited a pretty big setup that
started in the 0.x Puppet era and has evolved over time. Let me see if I
can parameterized ucdpuppet::kerberos::config:

class ucdpuppet::kerberos::config ($source = 
$ucdpuppet::kerberos::params::krb5_source) 
      inherits ucdpuppet::kerberos::params {

  file { $ucdpuppet::kerberos::params::krb5_conf_path: source => 
"puppet:///modules/ucdpuppet/kerberos/$source" }
}

Then in nodes/%{::trusted.certname}.yaml for any host that needs to
override the default in ucdpuppet::kerberos::params, I put:

ucdpuppet::kerberos::params::krb5_source: "krb5.conf.special"

> Note that the code you present appears to be using class inheritance 
> needlessly, and therefore inappropriately.  There are only two good reasons 
> for using class inheritance in Puppet:
> 
>    1. To perform resource overrides on resources declared by the parent 
>    class (or by a more distant ancestor)
>    2. To ensure that class variables of the parent class are available for 
>    use as class parameter defaults in the child class.

Like I said, inherited code base that started in the 0.x era, but given
the way I re-wrote ucdpuppet::kerberos::config above it looks like I fall
under 2). 

Hmmm, looking it over it seems like I could do:

class ucdpuppet::kerberos::config {
   include ucdpuppet::kerberos::params
                
   file { $ucdpuppet::kerberos::params::krb5_conf_path: source => 
"puppet:///modules/ucdpuppet/kerberos/${ucdpuppet::kerberos::params::krb5_source}"}
}

Will ADB kick in for that one, or does it only apply for class parameters?

Thanks!

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20160429165048.GA14536%40descolada.ucdavis.edu.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to