1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-15 08:21:31 +00:00

Add parameter warn_mpm_module to control when warning are raised

This commit is contained in:
Warkdev 2023-01-07 15:23:08 +01:00
parent 6fb212b104
commit cdee15acc8
4 changed files with 63 additions and 5 deletions

View file

@ -0,0 +1,34 @@
---
# This test represent the misleading behavior of the following issue: https://github.com/ansible-collections/community.general/issues/635
- name: Disable MPM event module
apache2_module:
name: "{{ item.module}}"
state: "{{ item.state}}"
ignore_configcheck: true
register: disable_mpm_modules
with_items:
- { module: mpm_event, state: absent }
- { module: mpm_prefork, state: present }
- assert:
that:
- "'warnings' in disable_mpm_modules"
- disable_mpm_modules["warnings"] == [
"No MPM module loaded! apache2 reload AND other module actions will fail if no MPM module is loaded immediately.",
"No MPM module loaded! apache2 reload AND other module actions will fail if no MPM module is loaded immediately."
]
- name: Disable MPM event module
apache2_module:
name: "{{ item.module}}"
state: "{{ item.state}}"
ignore_configcheck: true
warn_mpm_absent: False
register: disable_mpm_modules
with_items:
- { module: mpm_event, state: absent }
- { module: mpm_prefork, state: present }
- assert:
that:
- "'warnings' not in disable_mpm_modules"

View file

@ -180,7 +180,7 @@
- mpm_worker
- mpm_event
- mpm_prefork
ignore_errors: yes
ignore_errors: true
register: remove_with_configcheck
- name: ensure configcheck fails task with when run without mpm modules

View file

@ -45,3 +45,8 @@
that: modules_before.stdout == modules_after.stdout
when: ansible_os_family in ['Debian', 'Suse']
# centos/RHEL does not have a2enmod/a2dismod
- name: include misleading warning test
include: 635-apache2-misleading-warning.yml
when: ansible_os_family in ['Debian', 'Suse']
# centos/RHEL does not have a2enmod/a2dismod