add firewall

This commit is contained in:
Pim Kunis 2022-12-04 19:50:40 +01:00
parent 069089ee2f
commit c438daeb3d
2 changed files with 25 additions and 0 deletions

4
playbooks/firewall.yml Normal file
View file

@ -0,0 +1,4 @@
- name: Configure firewall
hosts: nucs
roles:
- firewall

View file

@ -0,0 +1,21 @@
- name: Install firewalld
apt:
pkg:
- firewalld
state: latest
update_cache: true
- name: Allow SSH
firewalld:
service: ssh
permanent: yes
state: enabled
- name: Allow DHCPv6
firewalld:
service: dhcpv6-client
permanent: yes
state: enabled
- name: Start firewalld
systemd:
enabled: true
name: sshd
state: started