1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/apache2_module/tasks/635-apache2-misleading-warning.yml
Cédric Servais 756c0776d6
apache2_module generates false/misleading warning (#5793)
* Add parameter warn_mpm_module to control when warning are raised

* Remoe whitespace

* Add changelog fragment

* Add missing license

* Update changelogs/fragments/5793-apache2-module-npm-warnings.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/apache2_module.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/apache2_module.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update tests/integration/targets/apache2_module/tasks/635-apache2-misleading-warning.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Refining integration test - previous was invalid

* False to false

* refactor assertion for suse

* Revert "refactor assertion for suse"

This reverts commit 61b86e7493.

* Excluding test on Suse

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-01-14 18:37:33 +01:00

47 lines
1.6 KiB
YAML

---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# 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: Enable MPM event module - Revert previous change
apache2_module:
name: "{{ item.module}}"
state: "{{ item.state}}"
ignore_configcheck: true
register: disable_mpm_modules
with_items:
- { module: mpm_prefork, state: absent }
- { module: mpm_event, state: present }
- 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"