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 }}"