1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-07-07 19:18:54 +00:00
community.general/tests/integration/targets/apache2_site/tasks/main.yml

40 lines
1.3 KiB
YAML

---
####################################################################
# WARNING: These are designed specifically for Ansible tests #
# and should not be used as examples of how to write Ansible roles #
####################################################################
# 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
- name: test apache2_site
block:
- name: get list of enabled sites before tests
ansible.builtin.command: ls /etc/apache2/sites-enabled/
register: sites_before
changed_when: false
- name: include actual tests
include_tasks: actualtest.yml
always:
- name: get list of enabled sites after tests
ansible.builtin.command: ls /etc/apache2/sites-enabled/
register: sites_after
changed_when: false
- name: sites before tests
ansible.builtin.debug:
var: sites_before.stdout_lines
- name: sites after tests
ansible.builtin.debug:
var: sites_after.stdout_lines
- name: ensure that all test sites are disabled again
ansible.builtin.assert:
that: sites_before.stdout == sites_after.stdout
when: ansible_facts.os_family == 'Debian'
# a2ensite/a2dissite are Debian/Ubuntu specific tools