ufw with range is not working, but its ongoing

This commit is contained in:
LUXEY Adrien 2021-01-17 21:35:19 +01:00
parent cb1f738eea
commit 8d5784f5fd
3 changed files with 7 additions and 6 deletions

View File

@ -62,17 +62,19 @@
ufw:
direction: in
from_ip: any
to_port: {{ site.coturn.listening_port }}
to_port: "{{ site.coturn.listening_port }}"
proto: any
rule: allow
comment: "coturn TCP/UDP"
become: true
- name: "Allow inbound UDP ports {{ site.coturn.min_port }}-{{ site.coturn.max_port }} for coturn un UFW"
- name: "Allow inbound ports {{ site.coturn.min_port }}-{{ site.coturn.max_port }}/UDP for coturn un UFW"
ufw:
direction: in
from_ip: any
to_port: "{{ item }}"
loop: "{{ range({{ site.coturn.min_port }}, {{ site.coturn.max_port }} + 1)|list }}"
become: true
#################

View File

@ -47,9 +47,9 @@ user-quota={{ site.coturn.user_quota }}
total-quota={{ site.coturn.total_quota }}
{% endif %}
{% for ip_range in matrix_coturn_denied_peer_ips %}
{% for ip_range in site.coturn.denied_peer_ips %}
denied-peer-ip={{ ip_range }}
{% endfor %}
{% for ip_range in matrix_coturn_allowed_peer_ips %}
{% for ip_range in site.coturn.allowed_peer_ips %}
allowed-peer-ip={{ ip_range }}
{% endfor %}

View File

@ -28,12 +28,11 @@ services:
# TCP/UDP: {{ site.coturn.listening_port }}
# UDP: {{ site.coturn.min_port }} - {{ site.coturn.max_port }}
network: host
#
volumes:
- type: tmpfs
target: /var/lib/coturn
- type: volume
source: "{{ sites_path }}/{{ site.slug }}/turnserver.conf"
source: "{{ sites_path }}/{{ site.slug }}/coturn/turnserver.conf"
destination: /etc/coturn/turnserver.conf
networks: