roles/ufw/tasks/main.yml - allow more flexible port config

specifically, allow specifying protocol
This commit is contained in:
Nick Stokoe
2021-02-07 16:02:15 +00:00
parent fcad61a6c4
commit 375172e34e

View File

@@ -16,13 +16,14 @@
policy: allow
direction: outgoing
- name: allow incoming traffic for ssh and web server
- name: incoming rules
ufw:
rule: allow
direction: in
to_port: "{{ item }}"
proto: tcp
with_items: "{{ ufw_allow_in }}"
to_port: "{{ item.port if 'port' in item else item }}"
proto: "{{ item.proto if 'proto' in item else 'tcp' }}"
loop: "{{ ufw_allow }}"
- name: enable ufw
ufw: