Peter Kristolaitis wrote:

> > How can I ensure that mpm_* is always the first element in the
> > array?
>
> Assuming you're trying to solve the problem I think you're trying to
> solve (i.e. to have Apache with the correct process model installed
> before any additional modules), it's important to note that
> reordering the array doesn't guarantee that.  The order in which
> Puppet applies resources is non-deterministic unless you have
> explicit ordering.
> 
> You're probably better off solving this problem in a different way;
> for example by creating a new data element (e.g.
> profiles::webserver::apache::process_model), and then specifying
> explicit ordering between the process_model package and the modules
> packages.

I'm using puppetlabs/apache to install apache. I already created 4
classes, apache24::install, apache24::modules, apache24::default_hosts
and apache::config to ensure the ordering of the installation process.

apache24::install includes apache{}, where I define "mpm_module =>
false," to be able to provide my own mpm_ module.

Then I call apache24::modules to install the appropriate mpm_ and other
modules.

Obviously the installation of cgi(d) checks the installation of a mpm_
module:

Error: Could not retrieve catalog from remote server: Error 400 on
SERVER: Could not find resource 'Class[Apache::Mod::Prefork]' for
relationship on 'Class[Apache::Mod::Cgi]' on node myhost

I therefore need to ensure that before all other modules an appropriate
mpm mpdule is installed

I helped mysqlf with

  # mpm must be the first module to install
  if /(mpm_.*)/ in $apacheModules {
    $mpmModule = [ $1 ]
    $apacheModulesTemp = delete($apacheModules, $mpmModule)
  } else {
    $apacheModulesTemp = $apacheModules
  }
  [...]
  $apacheModulesRevised = concat($mpmModule, $apacheModulesTemp)

but was wondering if there is an easier/cleaner/better solution.

-- 
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/xn0k7hedi9sg2jy000%40news.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to