add firewall
This commit is contained in:
parent
069089ee2f
commit
c438daeb3d
2 changed files with 25 additions and 0 deletions
4
playbooks/firewall.yml
Normal file
4
playbooks/firewall.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- name: Configure firewall
|
||||
hosts: nucs
|
||||
roles:
|
||||
- firewall
|
21
roles/firewall/tasks/main.yml
Normal file
21
roles/firewall/tasks/main.yml
Normal 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
|
Reference in a new issue