Skip to content

Commit

Permalink
Merge pull request #2349 from bastelfreak/mpm_event
Browse files Browse the repository at this point in the history
disable::mpm_event: Fix module deactivation
  • Loading branch information
david22swan authored Dec 6, 2022
2 parents 1d2302d + 1797602 commit 0b74e1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
26 changes: 4 additions & 22 deletions manifests/mpm/disable_mpm_event.pp
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
# @summary disable Apache-Module event
class apache::mpm::disable_mpm_event {
$event_command = ['/usr/sbin/a2dismod', 'event']
$event_onlyif = [['/usr/bin/test', '-e', join([$apache::mod_enable_dir, 'event.load'],'/')]]
exec { '/usr/sbin/a2dismod event':
$event_command = ['/usr/sbin/a2dismod', 'mpm_event']
$event_onlyif = [['/usr/bin/test', '-e', join([$apache::mod_enable_dir, 'mpm_event.load'],'/')]]
exec { '/usr/sbin/a2dismod mpm_event':
command => $event_command,
onlyif => $event_onlyif,
require => Package['httpd'],
before => Class['apache::service'],
}

$event_load_command = ['/bin/rm', join([$apache::mod_enable_dir, 'event_event.load'],'/')]
$event_load_onlyif = [['/usr/bin/test', '-e', join([$apache::mod_enable_dir, 'event_event.load'],'/')]]
exec { 'remove distribution event load file':
command => $event_load_command,
onlyif => $event_load_onlyif,
require => Package['httpd'],
before => Class['apache::service'],
}

$event_conf_command = ['/bin/rm', join([$apache::mod_enable_dir, 'event_event.conf'],'/')]
$event_conf_onlyif = [['/usr/bin/test', '-e', join([$apache::mod_enable_dir, 'event_event.conf'],'/')]]
exec { 'remove distribution event conf file':
command => $event_conf_command,
onlyif => $event_conf_onlyif,
require => Package['httpd'],
before => Class['apache::service'],
notify => Class['apache::service'],
}
}
2 changes: 1 addition & 1 deletion spec/classes/apache_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
{ mpm_module: 'worker' }
end

it { is_expected.to contain_exec('/usr/sbin/a2dismod event') }
it { is_expected.to contain_exec('/usr/sbin/a2dismod mpm_event') }
it { is_expected.to contain_exec('/usr/sbin/a2dismod prefork') }
end

Expand Down

0 comments on commit 0b74e1d

Please sign in to comment.