As a general rule you shouldn't have multiple profiles pulling the same
data from hiera.

Treat profiles like lego blocks that you can compose as needed.

In this case create a ssl_certs profile who's role is to pull in hieradata
via standard parameters. This profile has the responsibility to get the
certs on the box etc...

Any profiles that need ssl_certs can `include profile::ssl_certs`. Note
that if these profiles need to get the parameters of the ssl_certs class
they can be accessed via $profile::ssl_certs::parameter_name.

Hope that helps.

On Mon, Jun 12, 2017, 9:57 AM Christopher Wood <[email protected]>
wrote:

> How do you typically organize your data lookups when you want to use the
> same hiera data across multiple profiles, themselves possibly used across
> multiple roles?
>
> A cut down example with fake names:
>
> class role::mailserver {
>   include ::profile::http
>   include ::profile::smtp
> }
>
> class role::webserver {
>   include ::profile::http
> }
>
> class profile::http ($ssldata) {
>   class { 'apache':
>     ssldata => $ssldata,
>   }
> }
>
> class profile::smtp ($ssldata) {
>   class { 'postfix':
>     ssldata => $ssldata,
>   }
> }
>
> In this example $ssldata would be a hash of loopback+cert+key+chain sets.
>
> It seems like this is the exact case for the lookup() function but perhaps
> one of you had a better idea.
>
> (Humorously, I am also taking naming suggestions for the set of
> cross-profile hiera keys, however risky that is on a puppet-related list.)
>
> --
> 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/20170612165744.GA13854%40iniquitous.heresiarch.ca
> .
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CACx1-q3eywAy5Vvv2PDh3wtqNOk-myy8jJY6OV8a-NqJd_JK9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to