Hi,

I'm running puppet 3.8.x

I try to do something like


  hieradata/myhost.yaml

    my_apache::vhosts:
      'my_new_vhost':
        name:
        port:
        ssl:
        etc..

  modules/my_apache/manifests/init.pp

    class my_apache($vhosts = {}) {
      validate_hash($vhosts)
      $hiera_vhosts  = hiera_hash("${module_name}::vhosts", undef)
      include 'apache'
      create_resources('apache::vhost', $hiera_vhosts)
    }

and it's working.

Now I would like to add

  ssl_cert and ssl_key inside the configuration of apache_vhost.

The point is I have two other variables inside

  hieradata/OS.yaml
  hieradata/common.yaml

like

  ssl_pub_key
  ssl_priv_key

who are the default place of the cert files

So I cannot put something

    my_apache::vhosts:
      'my_new_vhost':
        name:
        port:
        ssl: true
        ssl_cert: $ssl_pub_key
        ssl_key: $ssl_priv_key

I don't want to put the real information because that's mean I duplicate
the information.

I still want the ssl_pub_key/ssl_priv_key inside my hieradata/common.yaml
because those variables are use in other module.

So the only way I see it is to put inside my

  modules/my_apache/manifests/init.pp

something like

    class my_apache($vhosts = {}) {
      $ssl_pub_key= hiera('ssl_pub_key')
      $ssl_priv_key=hiera('ssl_priv_key')

      validate_hash($vhosts)
      $hiera_vhosts  = hiera_hash("${module_name}::vhosts", undef)
      include 'apache'
      create_resources('apache::vhost', $hiera_vhosts)
    }

but I don't see how I can put those two informations inside the
hiera_vhosts values.

Regards.







--
Albert SHIH
DIO bâtiment 15
Observatoire de Paris
5 Place Jules Janssen
92195 Meudon Cedex
France
Téléphone : +33 1 45 07 76 26/+33 6 86 69 95 71
xmpp: j...@obspm.fr
Heure local/Local time:
lun 23 mai 2016 17:04:46 CEST

-- 
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/20160523151710.GA7687%40pcjas.obspm.fr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to