Classes and define in HIERA


I have classes (defines) not import in Foreman but how use in hiera?

apache::vhosts ?

Howto use with hiera ?

openldap::server::database { ‘dc=example,dc=com’:
directory => ‘/var/lib/ldap’,
rootdn => ‘cn=admin,dc=example,dc=com’,
rootpw => ‘secret’,

Both the puppet ENC and hiera don’t allow instantiating defines via the ENC. Usually you introduce profile classes that wrap functionality:

class profiles::webserver(
  Hash[String, Hash] $vhosts = {},
) {
  include apache

  $vhosts.each |$vhost_name, $vhost_options| {
    apache::vhost { $vhost_name:
      * => $vhost_options,

You usually want some changed defaults, perhaps add in some monitoring, set up letsencrypt.

OK, thanks

There is also, although @ekohl’s suggestion is better if you can manage writing the profile classes.