From 735a066d927686d925bcb6ec414c964f20fb409b Mon Sep 17 00:00:00 2001 From: Daniel Hoffend Date: Sun, 17 Aug 2025 12:52:49 +0200 Subject: [PATCH] apache2_module: updated cgi action conditions (#10423) * apache2_module: updated cgi action conditions Only the activation of the cgi module in threaded mode should be a restriction due to apache2 limitations, not the deactivation. Especially when the cgi module isn't enabled yet at all. Fixes #9140 * bug(fix): apache2_module fails to disable cgi module * Update changelog fragment. --------- Co-authored-by: Felix Fontein --- changelogs/fragments/10423-apache_module-condition.yml | 2 ++ plugins/modules/apache2_module.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/10423-apache_module-condition.yml diff --git a/changelogs/fragments/10423-apache_module-condition.yml b/changelogs/fragments/10423-apache_module-condition.yml new file mode 100644 index 0000000000..9a30d06b4e --- /dev/null +++ b/changelogs/fragments/10423-apache_module-condition.yml @@ -0,0 +1,2 @@ +bugfixes: + - apache2_module - check the ``cgi`` module restrictions only during activation (https://github.com/ansible-collections/community.general/pull/10423). diff --git a/plugins/modules/apache2_module.py b/plugins/modules/apache2_module.py index 99db968670..3a683d9883 100644 --- a/plugins/modules/apache2_module.py +++ b/plugins/modules/apache2_module.py @@ -258,8 +258,8 @@ def main(): ) name = module.params['name'] - if name == 'cgi' and _run_threaded(module): - module.fail_json(msg="Your MPM seems to be threaded. No automatic actions on module cgi possible.") + if name == 'cgi' and module.params['state'] == 'present' and _run_threaded(module): + module.fail_json(msg="Your MPM seems to be threaded, therefore enabling cgi module is not allowed.") if not module.params['identifier']: module.params['identifier'] = create_apache_identifier(module.params['name'])