summaryrefslogtreecommitdiffstats
path: root/ansible/roles/firewall/tasks/firewall-disable.yml
blob: 5f1ab537089b6d72c8735e43f53ef6af9c3b351d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
---
- name: Get installed packages list
  package_facts:
    manager: "auto"

- name: Stop and disable default OS firewall if exists
  service:
    name: "{{ firewall.package_name[ansible_facts.os_family] }}"
    state: stopped
    enabled: no
  when: firewall.package_name[ansible_facts.os_family] in ansible_facts.packages

- name: Flush iptables
  iptables:
    flush: true
  changed_when: false  # for idempotence