systemd units for wg interfaces

This commit is contained in:
Pim Kunis 2023-04-06 22:00:50 +02:00
parent 2ecd42e474
commit e4d80ec703
2 changed files with 9 additions and 0 deletions

View file

@ -9,3 +9,11 @@
src: "{{ role_path }}/templates/wg.conf.j2"
dest: "/etc/wireguard/{{ item.name }}.conf"
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 }}"

View file

@ -22,6 +22,7 @@ wireguard_interfaces:
61663539656433336135396362623862623336613464346139356466633365663939346366346335
3561326462646131346238633334613539623161653838386435
- name: atlas
always: true
address: "10.42.0.2/32"
peer_public_key: "NLI4IsIgb4if2FhP8BXJupTlC/guZfY4tG91dZ4t8jE="
endpoint: "atlas.lan:51820"