On 12/23/2013 02:52 PM, Josh wrote:
> Ramin,
>
> After looking more at your example for configuring apache mods via hiera, I
> have one problem.
>
> The create_resources will actually just define a resource like so:
>
> apache::mod { 'php' }
>
> However, to install the php module with puppetlabs/apache, I actually need
> to include the apache::mod::php class, ie:
>
> class { 'apache::mod::php' }
>
> Any ideas on how to make this work correctly? The hiera data should allow
> me to choose which apache::mod::subclass modules that should be installed.
>
> Thanks,
>
> Josh
> Hi, How are you declaring your classes to include from with in hiera? Is it similar to this? --- classes: - apache - apache::mod apache::someparamater: value apache::mod::php: blah If so, you should be able to do: --- classes: - apache - apache::mod::php apache::my_favorite_parameter: value apache::mod::php::php_parameter: some_other_vaule I haven't tried that exact thing with the apache module, but it does work for other modules with sub-classes that I've been working with. That is assuming that you're using the 'classes' array with the hiera_include function. We use the create_resources function to create wrappers for defines, while regular classes are included via the hiera_include and classes array. Our setup was pretty much taken directly from the hiera documentation: http://docs.puppetlabs.com/hiera/1/puppet.html#assigning-classes-to-nodes-with-hiera-hierainclude There are some gotchas that come up with the hiera merge behavior depending on how complex you're hiera layout becomes. For example, we had to set the hiera merge_behavior to deeper for us to get some of the desired results that we were looking for. -- Joseph Swick <[email protected]> Operations Engineer Meltwater Group
signature.asc
Description: OpenPGP digital signature
