-
Notifications
You must be signed in to change notification settings - Fork 0
/
n2n-edge-conf.yaml
30 lines (27 loc) · 774 Bytes
/
n2n-edge-conf.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
- import_tasks: n2n-edge-preset.yaml
- name: n2n edge | conf
become: true
copy:
dest: '{{ edge.conf }}'
content: |
--tun-device={{ edge.netname|default(edge.instance) }}
--community={{ edge.community }}
-k={{ edge.password }}
-a={{ edge.address }}
-s={{ edge.netmask }}
--supernode-list={{ edge.supernodes }}
{{'-r' if (edge.forward|default(false))}}
{{ edge.extras | default('') }}
register: conf
- name: n2n edge | restart
become: true
command: service edge --ifstarted restart
when:
- conf.changed
- edge.instance is undefined
- name: n2n edge | instance restart
become: true
command: service edge.{{ edge.instance }} --ifstarted restart
when:
- conf.changed
- edge.instance is defined