summaryrefslogtreecommitdiffstats
path: root/roles/common/tasks/firewall.yml
blob: 2913a9e5520d0d4544fa9b3e5b3415de2c9d7a39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
- name: Install some packages required for the firewall
  apt: pkg={{ item }}
  with_items:
    - iptables
    - netmask
    - bsdutils

- name: Create directory /etc/iptables
  file: path=/etc/iptables
        owner=root group=root
        state=directory
        mode=0755

- name: Generate /etc/iptables/services
  template: src=etc/iptables/services.j2
            dest=/etc/iptables/services
            owner=root group=root
            mode=0600
  notify:
    - Unsafe firewall update

- name: Copy /usr/local/sbin/update-firewall.sh
  copy: src=usr/local/sbin/update-firewall.sh
        dest=/usr/local/sbin/update-firewall.sh
        owner=root group=root
        mode=0755
  notify:
    - Unsafe firewall update

- name: Make the iptable ruleset persistent
  copy: src=etc/network/if-pre-up.d/iptables
        dest=/etc/network/if-pre-up.d/iptables
        owner=root group=root
        mode=0755