systemd units for wg interfaces
This commit is contained in:
parent
2ecd42e474
commit
e4d80ec703
2 changed files with 9 additions and 0 deletions
|
@ -9,3 +9,11 @@
|
||||||
src: "{{ role_path }}/templates/wg.conf.j2"
|
src: "{{ role_path }}/templates/wg.conf.j2"
|
||||||
dest: "/etc/wireguard/{{ item.name }}.conf"
|
dest: "/etc/wireguard/{{ item.name }}.conf"
|
||||||
loop: "{{ wireguard_interfaces }}"
|
loop: "{{ wireguard_interfaces }}"
|
||||||
|
- name: Enable interfaces
|
||||||
|
become: true
|
||||||
|
systemd:
|
||||||
|
name: "wg-quick@{{ item.name }}"
|
||||||
|
enabled: true
|
||||||
|
state: started
|
||||||
|
when: '"always" in item and item.always'
|
||||||
|
loop: "{{ wireguard_interfaces }}"
|
||||||
|
|
|
@ -22,6 +22,7 @@ wireguard_interfaces:
|
||||||
61663539656433336135396362623862623336613464346139356466633365663939346366346335
|
61663539656433336135396362623862623336613464346139356466633365663939346366346335
|
||||||
3561326462646131346238633334613539623161653838386435
|
3561326462646131346238633334613539623161653838386435
|
||||||
- name: atlas
|
- name: atlas
|
||||||
|
always: true
|
||||||
address: "10.42.0.2/32"
|
address: "10.42.0.2/32"
|
||||||
peer_public_key: "NLI4IsIgb4if2FhP8BXJupTlC/guZfY4tG91dZ4t8jE="
|
peer_public_key: "NLI4IsIgb4if2FhP8BXJupTlC/guZfY4tG91dZ4t8jE="
|
||||||
endpoint: "atlas.lan:51820"
|
endpoint: "atlas.lan:51820"
|
||||||
|
|
Reference in a new issue