new version
Some checks failed
Some checks failed
This commit is contained in:
@@ -1,27 +1,9 @@
|
||||
---
|
||||
- name: Install UFW firewall
|
||||
ansible.builtin.apt:
|
||||
name: ufw
|
||||
state: present
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- name: Configure UFW defaults
|
||||
- name: Configuration UFW - politique par défaut
|
||||
community.general.ufw:
|
||||
direction: "{{ item.direction }}"
|
||||
policy: "{{ item.policy }}"
|
||||
loop:
|
||||
- { direction: 'incoming', policy: 'deny' }
|
||||
- { direction: 'outgoing', policy: 'allow' }
|
||||
notify: reload firewall
|
||||
|
||||
- name: Allow TCP ports
|
||||
community.general.ufw:
|
||||
rule: allow
|
||||
port: "{{ item }}"
|
||||
proto: tcp
|
||||
loop: "{{ firewall_allowed_tcp_ports }}"
|
||||
notify: reload firewall
|
||||
|
||||
- name: Enable UFW
|
||||
community.general.ufw:
|
||||
state: enabled
|
||||
with_items:
|
||||
- { direction: 'incoming', policy: "{{ ufw_default_incoming }}" }
|
||||
- { direction: 'outgoing', policy: "{{ ufw_default_outgoing }}" }
|
||||
notify: enable ufw
|
Reference in New Issue
Block a user