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: ufw:
direction: in direction: in
from_ip: any from_ip: any
to_port: {{ site.coturn.listening_port }} to_port: "{{ site.coturn.listening_port }}"
proto: any proto: any
rule: allow rule: allow
comment: "coturn TCP/UDP" 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: ufw:
direction: in direction: in
from_ip: any from_ip: any
to_port: "{{ item }}" to_port: "{{ item }}"
loop: "{{ range({{ site.coturn.min_port }}, {{ site.coturn.max_port }} + 1)|list }}" 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 }} total-quota={{ site.coturn.total_quota }}
{% endif %} {% endif %}
{% for ip_range in matrix_coturn_denied_peer_ips %} {% for ip_range in site.coturn.denied_peer_ips %}
denied-peer-ip={{ ip_range }} denied-peer-ip={{ ip_range }}
{% endfor %} {% endfor %}
{% for ip_range in matrix_coturn_allowed_peer_ips %} {% for ip_range in site.coturn.allowed_peer_ips %}
allowed-peer-ip={{ ip_range }} allowed-peer-ip={{ ip_range }}
{% endfor %} {% endfor %}

View file

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