|
5 | 5 | {% set ifname = uplink['ifname'] if mode == 'direct' else 'br-'+name %}
|
6 | 6 |
|
7 | 7 | config tunspace "tunspace"
|
| 8 | + # Namespace where the uplink will live. |
8 | 9 | option uplink_netns "{{ name }}"
|
| 10 | + # Existing interface that we'll use as the uplink. |
9 | 11 | option uplink_ifname "{{ ifname }}"
|
| 12 | + # How the uplink in the namespace is constructed. |
| 13 | + # - bridge: creates a macvlan child in bridge mode, useful for creating multiple uplinks from the same original uplink interface. |
| 14 | + # - direct: moves the original uplink interface into the namespace directly, useful for wonky cheap USB sticks with broken drivers. |
10 | 15 | option uplink_mode "{{ mode }}"
|
| 16 | + # Our own static uplink IPv4 address in CIDR format. Leave empty to use DHCP. |
11 | 17 | option uplink_ipv4 "{{ uplink['uplink_ipv4']|default('') }}"
|
| 18 | + # IPv4 address of the gateway. Required in combination with uplink_ipv4, ignored when using DHCP. |
12 | 19 | option uplink_gateway "{{ uplink['uplink_gateway']|default('') }}"
|
| 20 | + # Maintenance consists of checking the uplink, refreshing the DHCP lease, checking the tunnel endpoints, and switching endpoints if neccessary. |
13 | 21 | option maintenance_interval 60
|
14 |
| - option debug 0 |
| 22 | + # Enables detailed output of Tunspace's operations. If disabled, only tunnel endpoint changes are reported. |
| 23 | + option debug "0" |
15 | 24 | {% endfor %}
|
16 | 25 |
|
17 | 26 | {% for tunnel in networks | selectattr('role', 'equalto', 'tunnel') %}
|
18 | 27 | config wg-interface
|
19 | 28 | option ifname "{{ tunnel['ifname'] }}"
|
20 | 29 | option ipv6 "fe80::2/64"
|
21 | 30 | option ipv4 "{{ tunnel['prefix'] }}"
|
22 |
| - option mtu {{ tunnel['mtu'] }} |
23 |
| - option port {{ tunnel['wireguard_port'] }} |
24 |
| - option disabled 0 |
| 31 | + option mtu "{{ tunnel['mtu'] }}" |
| 32 | + option port "{{ tunnel['wireguard_port'] }}" |
| 33 | + option disabled "0" |
25 | 34 |
|
26 | 35 | {% endfor %}
|
27 | 36 |
|
28 | 37 | {% for gateway in groups['role_gateway'] | sort %}
|
29 | 38 | config wg-server
|
30 | 39 | option name "{{ gateway }}"
|
31 | 40 | option url "https://{{ hostvars[gateway]['uplink']['ipv4'] | ansible.utils.ipaddr('address') }}/ubus"
|
32 |
| - option insecure_cert 1 |
33 |
| - option disabled 0 |
| 41 | + option insecure_cert "1" |
| 42 | + option disabled "0" |
34 | 43 |
|
35 | 44 | {% endfor %}
|
0 commit comments