main.yml (449B)
1 --- 2 - name: Install ufw 3 apt: 4 name: ufw 5 state: present 6 update_cache: true 7 8 - name: Deny all incoming traffic by default 9 ufw: 10 default: deny 11 direction: incoming 12 - name: Allow ssh 13 ufw: 14 rule: allow 15 port: '22' 16 proto: tcp 17 - name: Allow http 18 ufw: 19 rule: allow 20 port: '80' 21 proto: tcp 22 23 - name: Allow https 24 ufw: 25 rule: allow 26 port: '443' 27 proto: tcp 28 29 - name: enable ufw 30 ufw: 31 state: enabled 32 33 -