Commit aea3b021 authored by ale's avatar ale

Handle dashes in hostnames for Tinc

Tinc breaks if it finds dashes in node names, so replace them
with underscores (cf. https://www.tinc-vpn.org/pipermail/tinc/2003-January/000605.html)
parent 027edf53
Pipeline #8348 failed with stages
in 7 minutes and 12 seconds
......@@ -27,7 +27,7 @@
# some reason (failures) we weren't able to fetch it.
- name: Install tinc host configuration
copy:
dest: "{{ tinc_dir}}/hosts/{{ h }}"
dest: "{{ tinc_dir}}/hosts/{{ h | regex_replace('-', '_') }}"
content: "{{ hostvars[h]['tinc_host_config'] }}"
with_items: "{{ groups['overlay-' + tinc_net] | list }}"
loop_control:
......
Name = {{ inventory_hostname }}
Name = {{ inventory_hostname | regex_replace('-', '_') }}
# Bind to all v4/v6 interfaces.
AddressFamily = any
......@@ -15,6 +15,6 @@ ReplayWindow = 32
# Connect to all other known nodes (full mesh).
{% for host in groups['overlay-' + tinc_net]|sort %}
ConnectTo = {{ host }}
ConnectTo = {{ host | regex_replace('-', '_') }}
{% endfor %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment