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
> You're overloading profile because you're not using Hiera or an
> ENC.
> Take this example
>
> class role::app1_fe { # or perhaps ::fe_app1
> include profile::apache
> include profile::php
> }
>
> class profile::apache {
> include apache
>
> $mymods = hiera('apache::a2mods', {})
> create_resources('apache::a2mod', $mymods)
> $myvhosts = hiera('apache::vhosts', {})
> create_resources('apache::vhost', $myvhosts)
>
> }
>
> profile::apache can be used by *any* server that needs Apache because by
> default it does nothing but the minimal config of Apache. However if you
> were to feed it data such as modules to enable or vhosts to load you
> could build any Apache server you might need.
>
> hieradata/app1_fe.yaml # this assumes you have a role fact.
> ---
> apache::a2mods:
> expires: {}
> headers: {}
> rewrite: {}
> apache::vhosts:
> www.example.com: {}
>
> Structures like profile::webserver::app1 indicate you're mixing roles
> and profiles. And you also embedding data into your Puppet code rather
> than writing code to consume data.
>
> It's a lot to wrap your head around and from my experience it
> takes 1-2
> restructures of your Puppet code to fully understand it.
>
> Ramin
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/72124198-748e-4e3e-8bb5-75c333edb8b5%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.