0

Recently I've been getting a very strange error when running my Puppet server.

Error message:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER:
Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error:
Error while evaluating a Function Call, apache::mod::php requires apache::mod::prefork or apache::mod::itk; please enable mpm_module => 'prefork' or mpm_module => 'itk' on Class['apache'] at /etc/puppetlabs/code/environments/ams/modules/apache/manifests/mod/php.pp:21:3 at /etc/puppetlabs/code/environments/ams/modules/roles/manifests/webserver.pp:78 on node dev.puppet.ams.packed.be

The strange this is that webserver.pp includes a class roles::webserver::apache which has the class declaration the error refers to in it. The class is included before any call to apache::mod::php.

webserver.pp:

class {'roles::webserver::apache':
  options => $options['apache'],
}

webserver/apache.pp:

class roles::webserver::apache (Hash $options) {
 class { 'apache':
    purge_vhost_dir => true,
    default_vhost => false,
    default_mods => $options['default_mods'],
    serveradmin => 'it@packed.be',
    server_signature => 'Off',
    mpm_module => 'prefork',
  }
}

I've checked both files and the hiera data files for syntax errors, but found none.

Any idea what's going on here?

1 Answers1

0

I have found the issue and solution with some help from the folks at Puppet.

What I had to do is convert class roles::webserver::apache to class that does not take any parameters and include it instead of declaring it as a resource.

include roles::webserver::apache

I had to include it in both webserver.pp and in all classes that used apache resources or classes:

class roles::webserver::service::website () {

  include roles::webserver::apache

  apache::vhost {'website':
    ...
  }

}