2020-03-09 10:11:07 +01:00
|
|
|
---
|
2020-09-25 08:01:17 +02:00
|
|
|
####################################################################
|
|
|
|
# WARNING: These are designed specifically for Ansible tests #
|
|
|
|
# and should not be used as examples of how to write Ansible roles #
|
|
|
|
####################################################################
|
|
|
|
|
2022-08-05 21:31:34 +02:00
|
|
|
# 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
|
2020-03-09 10:11:07 +01:00
|
|
|
|
2021-07-30 18:07:38 +02:00
|
|
|
- name: install apache via apt
|
|
|
|
apt:
|
|
|
|
name: "{{item}}"
|
|
|
|
state: present
|
|
|
|
when: "ansible_os_family == 'Debian'"
|
|
|
|
with_items:
|
|
|
|
- apache2
|
|
|
|
- libapache2-mod-evasive
|
2020-03-09 10:11:07 +01:00
|
|
|
|
2021-07-30 18:07:38 +02:00
|
|
|
- name: install apache via zypper
|
|
|
|
community.general.zypper:
|
|
|
|
name: apache2
|
|
|
|
state: present
|
|
|
|
when: "ansible_os_family == 'Suse'"
|
|
|
|
|
|
|
|
- name: test apache2_module
|
2020-03-09 10:11:07 +01:00
|
|
|
block:
|
|
|
|
- name: get list of enabled modules
|
|
|
|
shell: apache2ctl -M | sort
|
|
|
|
register: modules_before
|
|
|
|
- name: include only on supported systems
|
2023-05-19 20:25:04 +02:00
|
|
|
include_tasks: actualtest.yml
|
2020-03-09 10:11:07 +01:00
|
|
|
always:
|
|
|
|
- name: get list of enabled modules
|
|
|
|
shell: apache2ctl -M | sort
|
|
|
|
register: modules_after
|
2021-07-30 18:07:38 +02:00
|
|
|
- name: modules_before
|
|
|
|
debug:
|
|
|
|
var: modules_before
|
|
|
|
- name: modules_after
|
|
|
|
debug:
|
|
|
|
var: modules_after
|
2020-03-09 10:11:07 +01:00
|
|
|
- name: ensure that all test modules are disabled again
|
|
|
|
assert:
|
|
|
|
that: modules_before.stdout == modules_after.stdout
|
|
|
|
when: ansible_os_family in ['Debian', 'Suse']
|
|
|
|
# centos/RHEL does not have a2enmod/a2dismod
|
2023-01-14 18:37:33 +01:00
|
|
|
|
|
|
|
- name: include misleading warning test
|
2023-05-19 20:25:04 +02:00
|
|
|
include_tasks: 635-apache2-misleading-warning.yml
|
2023-01-14 18:37:33 +01:00
|
|
|
when: ansible_os_family in ['Debian']
|
|
|
|
# Suse has mpm_event module compiled within the base apache2
|