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 policy: allow
direction: outgoing direction: outgoing
- name: allow incoming traffic for ssh and web server - name: incoming rules
ufw: ufw:
rule: allow rule: allow
direction: in direction: in
to_port: "{{ item }}" to_port: "{{ item.port if 'port' in item else item }}"
proto: tcp proto: "{{ item.proto if 'proto' in item else 'tcp' }}"
with_items: "{{ ufw_allow_in }}" loop: "{{ ufw_allow }}"
- name: enable ufw - name: enable ufw
ufw: ufw: