Something like the following might work. class profile::app1_site class {'apache::mod::php':} package { 'php5-brcypt': } # etc etc }
I've avoided parameterized classes for historical reasons, but Joseph's method should work. It does require some restructuring.
fwiw not a fan of the apache::mod set of functionality unless the module is part of Apache core. I've noticed there is now a puppetlabs-passenger module to handle the complexities apache::mod { 'passenger': } could not. Assuming your PHP config is more than just installing the Apache module I recommend following the same logic and making your own PHP module with a module and local conf define. Wrap that in profile::php with the needed create_resources and add it to the role.
Ramin On 12/23/2013 12:44 PM, Josh wrote:
Joseph, I'm not currently defining classes with hiera. The host is assigned a role, which includes a profile, which installs includes ::apache. I guess this may be something that we need to look at for these types of scenarios. 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 <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 <joseph...@meltwater.com <javascript:>> Operations Engineer Meltwater Group -- 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/c7ba4374-1b14-4dfc-8165-97122836141a%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
-- 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/52B8A956.5050108%40badapple.net. For more options, visit https://groups.google.com/groups/opt_out.