- name: Install wireguard
become: true
apt:
name: wireguard
state: present
- name: Install home.conf
template:
src: "{{ role_path }}/templates/wg.conf.j2"
dest: "/etc/wireguard/{{ item.name }}.conf"
loop: "{{ wireguard_interfaces }}"
- name: Enable interfaces
systemd:
name: "wg-quick@{{ item.name }}"
enabled: true
state: started
when: '"always" in item and item.always'