puppetlabs-apache icon indicating copy to clipboard operation
puppetlabs-apache copied to clipboard

Cannot use apache::mod::prefork with apache::mod::php

Open xchotard-talentsoft opened this issue 2 years ago • 1 comments

Describe the Bug

Try to pass custom configuration to mpm_prefork, using the apache::mod::prefork class with arguments fails if apache::mod::php is also used.

Expected Behavior

It should be possible to customize mpm_prefork regardless of php status.

Steps to Reproduce

Code example 1:

class { 'apache':
  mpm_module => 'prefork',
}

class { 'apache::mod::php': }

class { 'apache::mod::prefork':
  maxspareservers => 20,
}

Returns an error (short version):

Duplicate declaration: Class[Apache::Mod::Prefork] is already declared; cannot redeclare

Code example 2:

class { 'apache': }

class { 'apache::mod::php': }

class { 'apache::mod::prefork':
  maxspareservers => 20,
}

Also returns an error (short version):

apache::mod::php requires apache::mod::prefork or apache::mod::itk; please enable mpm_module => 'prefork' or mpm_module => 'itk' on Class['apache']

According to REFERENCE.md, the mpm_module parameter must be set to false, in order to be able to use apache::mod::prefork:

class { 'apache':
  mpm_module => false,
}

class { 'apache::mod::php': }

class { 'apache::mod::prefork':
  maxspareservers     => 20,
}

But this does not seems to work either:

apache::mod::php requires apache::mod::prefork or apache::mod::itk; please enable mpm_module => 'prefork' or mpm_module => 'itk' on Class['apache']

Environment

  • Version: main (currently 8.1.0)
  • Puppet version: 6.28.0-1focal
  • Platform: Ubuntu 20.04

Additional Context

Add any other context about the problem here.

xchotard-talentsoft avatar Aug 23 '22 14:08 xchotard-talentsoft

I think the only option is to use Hiera:

include apache
include apache::mod::php

Then use Hiera:

apache::mpm_module: prefork
apache::mod::prefork::maxspareservers: 20

ekohl avatar Aug 23 '22 15:08 ekohl

Hello! 👋

This issue has been open for a while and has had no recent activity. We've labelled it with attention-needed so that we can get a clear view of which issues need our attention.

If you are waiting on a response from us we will try and address your comments on a future Community Day.

Alternatively, if it is no longer relevant to you please close the issue with a comment.

github-actions[bot] avatar Dec 05 '22 01:12 github-actions[bot]