summaryrefslogtreecommitdiff
path: root/roles/configure_iptables/tasks/main.yml
blob: 34f6c2755764c85577d14c98ea77872c1581d31f (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
---
- name: copy iptables.rules
  copy:
      src: iptables.rules
      dest: /etc/iptables/iptables.rules
  register: iptables_rules

- name: start and enable iptables service
  when: iptables_rules.changed
  systemd:
      name: iptables.service
      enabled: yes
      state: reloaded

- name: copy ip6tables.rules
  copy:
      src: ip6tables.rules
      dest: /etc/iptables/ip6tables.rules
  register: ip6tables_rules

- name: start and enable ip6tables service
  when: ip6tables_rules.changed
  systemd:
      name: ip6tables.service
      enabled: yes
      state: reloaded