Hi,

When I read some recommendation about using hieradata/profile/roles I
always find people saying to put the data inside the profile (in hiera)
like

profile::cms::key1: value1
profile::mysql::key2: value2
profile::webserveur::key3: value3

Why it's not recommended to put the value inside the role like

role::my_cms::key1: value1
role::my_cms::key2: value2
role::my_cms::key3: value3

then inside the

  role/my_cms/init.pp

do something like

  class role::my_cms (
    $key1,
    $key2,
    $key3,
    )
  {
  class {'profile::cms':
    key1 => $key1
    }

  class {'profile::mysql':
    key2 => $key2
    }
  etc.

The reason I ask is, if the key1/value1 is the (for example) the password of the
database, I can either do

profile::cms::key1: value1
profile::mysql::key2: "%hiera('profile::cms::key1')

or put all "intelligence" inside the role by

  class role::my_cms (
    $key1,
    $key2,
    $key3,
    )
  {
  class {'profile::cms':
    key1 => $key1
    }

  class {'profile::mysql':
    key2 => $key1
    }

I find this second solution more clean, because the guy who need to create
a cms just got to put all information inside the hieradata (without
understand the hiera('profile::cms::Key1') )

Regards.


--
Albert SHIH
DIO bātiment 15
Observatoire de Paris
5 Place Jules Janssen
92195 Meudon Cedex
France
xmpp: j...@obspm.fr
Heure local/Local time:
mer 16 nov 2016 08:34:00 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20161116074512.GB28124%40pcjas.obspm.fr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to