|
@@ -6,15 +6,19 @@
|
6
|
6
|
apt: pkg=ufw state=present
|
7
|
7
|
tags:
|
8
|
8
|
- dependencies
|
|
9
|
+ - ufw
|
9
|
10
|
|
10
|
11
|
- name: Deny everything
|
11
|
12
|
ufw: policy=deny
|
|
13
|
+ tags: ufw
|
12
|
14
|
|
13
|
15
|
- name: Set firewall rule for DNS
|
14
|
16
|
ufw: rule=allow port=domain
|
|
17
|
+ tags: ufw
|
15
|
18
|
|
16
|
19
|
- name: Set firewall rule for mosh
|
17
|
20
|
ufw: rule=allow port=60000:61000 proto=udp
|
|
21
|
+ tags: ufw
|
18
|
22
|
|
19
|
23
|
- name: Set firewall rules for web traffic and SSH
|
20
|
24
|
ufw: rule=allow port={{ item }} proto=tcp
|
|
@@ -22,15 +26,19 @@
|
22
|
26
|
- http
|
23
|
27
|
- https
|
24
|
28
|
- ssh
|
|
29
|
+ tags: ufw
|
25
|
30
|
|
26
|
31
|
- name: Enable UFW
|
27
|
32
|
ufw: state=enabled
|
|
33
|
+ tags: ufw
|
28
|
34
|
|
29
|
35
|
- name: Check config of ufw
|
30
|
36
|
command: cat /etc/ufw/ufw.conf
|
31
|
37
|
register: ufw_config
|
32
|
38
|
changed_when: False # never report as "changed"
|
|
39
|
+ tags: ufw
|
33
|
40
|
|
34
|
41
|
- name: Disable logging (workaround for known bug in Debian 7)
|
35
|
42
|
ufw: logging=off
|
36
|
43
|
when: "ansible_lsb['codename'] == 'wheezy' and 'LOGLEVEL=off' not in ufw_config.stdout"
|
|
44
|
+ tags: ufw
|