openpunk-ansible/roles/firewall/tasks/main.yml

33 lines
557 B
YAML
Raw Normal View History

2022-05-30 15:46:36 +00:00
---
- name: Allow port 22
community.general.ufw:
rule: allow
port: '22'
proto: tcp
- name: Allow port 80
community.general.ufw:
rule: allow
port: '80'
proto: tcp
- name: Allow port 443
community.general.ufw:
rule: allow
port: '443'
2022-06-08 19:23:15 +00:00
proto: tcp
- name: Startup UFW
community.general.ufw:
state: enabled
- name: Copy fail2ban jail config
copy:
src: jails.local
2022-06-08 19:23:15 +00:00
dest: /etc/fail2ban/jail.d/jails.local
- name: Enable fail2ban service
systemd:
name: fail2ban
enabled: yes
2022-08-02 18:32:19 +00:00
state: started