Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/ufw/tasks/main.yml

raw
1 ---
2 ####################################################################
3 # WARNING: These are designed specifically for Ansible tests #
4 # and should not be used as examples of how to write Ansible roles #
5 ####################################################################
6
7 # Copyright (c) Ansible Project
8 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
9 # SPDX-License-Identifier: GPL-3.0-or-later
10
11 - name: Install iptables (SuSE only)
12 package:
13 name: iptables
14 become: true
15 when: ansible_facts.os_family == 'Suse'
16 - name: Install ufw
17 become: true
18 package:
19 name: ufw
20
21 # Run the tests
22 - block:
23 - include_tasks: run-test.yml
24 with_fileglob:
25 - "tests/*.yml"
26 become: true
27
28 # Cleanup
29 always:
30 - pause:
31 # ufw creates backups of the rule files with a timestamp; if reset is called
32 # twice in a row fast enough (so that both timestamps are taken in the same second),
33 # the second call will notice that the backup files are already there and fail.
34 # Waiting one second fixes this problem.
35 seconds: 1
36 - name: Reset ufw to factory defaults and disable
37 ufw:
38 state: reset