2018-12-29 14:50:04 +01:00
|
|
|
---
|
|
|
|
# Make sure ufw is installed
|
|
|
|
- name: Install EPEL repository (RHEL only)
|
|
|
|
yum:
|
|
|
|
name: https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
|
|
|
|
state: present
|
|
|
|
when: ansible_distribution == 'RedHat'
|
|
|
|
- name: Install iptables (SuSE only)
|
|
|
|
package:
|
|
|
|
name: iptables
|
|
|
|
when: ansible_os_family == 'Suse'
|
|
|
|
- name: Install ufw
|
|
|
|
package:
|
|
|
|
name: ufw
|
2019-01-08 14:00:20 +01:00
|
|
|
|
2018-12-29 14:50:04 +01:00
|
|
|
# Run the tests
|
|
|
|
- block:
|
|
|
|
- include_tasks: run-test.yml
|
|
|
|
with_fileglob:
|
|
|
|
- "tests/*.yml"
|
2019-01-08 14:00:20 +01:00
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
always:
|
|
|
|
- name: Reset ufw to factory defaults and disable
|
|
|
|
ufw:
|
|
|
|
state: reset
|