Is there a way to create the require parameter by hiera? Maybe it's possible to lookup but I am new to puppet and don't know all possibilities.
I am using the oneview-puppet module to create resources from a puppet apply.
The resources were created by hiera defined as one config file (YAML). There I am combining several resources from the module above. These resources have complicated dependencies. An overview can be found here (page 29).
So for each resource I have to require the dependencies although it could "found" in my config file. Actual it only works when the resources created by it's sequence in the site/manifest/init.pp.
I've tried to add the require paremeter in hiera, but there it will be interpreted as a string.
site/oneviewconf/manifest/init.pp example:
class oneviewconf (
Hash $oneview_ethernet_networks = {},
Hash $oneview_logical_interconnect_groups = {}
)
{
$oneview_ethernet_networks.each | $k,$v | {
oneview_ethernet_network { $k: # -> oneview-puppet resource
* => $v,
}
}
$oneview_logical_interconnect_groups.each | $k,$v | {
oneview_logical_interconnect_group { $k: # -> oneview-puppet resource
require => Oneview_ethernet_network['VLAN0001']
* => $v,
}
}
}
Hiera example:
---
oneviewconf::oneview_ethernet_networks:
VLAN0001:
ensure: present
data:
name: 'VLAN0001'
vlanId: 0001
oneviewconf::oneview_logical_interconnect_groups:
LIG_A:
ensure: present
data:
name: 'LIG_A'
networkUris: ['VLAN0001']