add ufw rule to allow traffic to server

This commit is contained in:
Antonio J. Delgado 2023-04-20 14:21:24 +03:00
parent 3352d9fa57
commit 768c54b227

View file

@ -78,3 +78,14 @@
enabled: true
daemon_reload: true
masked: false
- name: Get host public IP
uri:
url: https://api.ipify.org?format=json
register: pub_ip
- name: Allow traffic to server
ufw:
rule: allow
from: "{{ pub_ip.json.ip }}"
delegate_to: "{{ groups['wireguard_server'][0] }}"