2021-05-18 21:45:30 +08:00
|
|
|
---
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Disable firewalld and ufw
|
2023-08-10 15:57:27 +08:00
|
|
|
when:
|
|
|
|
- disable_service_firewall is defined and disable_service_firewall
|
2023-07-26 22:36:22 +08:00
|
|
|
block:
|
2021-05-18 21:45:30 +08:00
|
|
|
- name: List services
|
|
|
|
service_facts:
|
|
|
|
|
|
|
|
- name: Disable service firewalld
|
|
|
|
systemd:
|
|
|
|
name: firewalld
|
|
|
|
state: stopped
|
|
|
|
enabled: no
|
|
|
|
when:
|
2023-08-25 10:05:17 +08:00
|
|
|
"'firewalld.service' in services and services['firewalld.service'].status != 'not-found'"
|
2021-05-18 21:45:30 +08:00
|
|
|
|
|
|
|
- name: Disable service ufw
|
|
|
|
systemd:
|
|
|
|
name: ufw
|
|
|
|
state: stopped
|
|
|
|
enabled: no
|
|
|
|
when:
|
2023-08-25 10:05:17 +08:00
|
|
|
"'ufw.service' in services and services['ufw.service'].status != 'not-found'"
|