summaryrefslogtreecommitdiffstats
path: root/ansible/roles/firewall/tasks/firewall-disable.yml
blob: 9a8a2c10ca8d8efe5aef04e52b29d563d31f2e36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
---
- name: Check if firewalld is installed
  yum:
    list: firewalld
    disablerepo: "*"
  register: firewalld_check

- name: Stop and disable firewalld if exists
  service:
    name: firewalld
    state: stopped
    enabled: no
  when: firewalld_check.results|selectattr('yumstate', 'match', 'installed')|list|length != 0

- name: Flush iptables
  iptables:
    flush: true