This repository has been archived on 2024-04-30. You can view files and clone it, but cannot push or open issues or pull requests.
setup/roles/wireguard/tasks/main.yml

20 lines
479 B
YAML
Raw Permalink Normal View History

2023-01-09 18:43:01 +00:00
- name: Install wireguard
become: true
apt:
name: wireguard
state: present
- name: Install home.conf
become: true
template:
2023-04-06 18:27:58 +00:00
src: "{{ role_path }}/templates/wg.conf.j2"
dest: "/etc/wireguard/{{ item.name }}.conf"
loop: "{{ wireguard_interfaces }}"
2023-04-06 20:00:50 +00:00
- 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 }}"