machine_setup/ansible/roles/wireguard/tasks/linux.yaml

25 lines
650 B
YAML
Raw Normal View History

2022-12-03 22:16:37 +00:00
- name: Install packages
package:
name:
- wireguard-tools
- qrencode # For generating qr codes to send to phone with `qrencode -t ansiutf8 -r <config_file>`
- systemd-resolvconf # For wg-quick to regenerate resolv.conf
state: present
- name: Configure wireguard
copy:
src: "{{ item }}"
dest: /etc/wireguard/
mode: 0440
owner: root
group: root
with_fileglob: "files/wireguard_configs/{{ wireguard_directory }}/*.conf"
- name: Enable Wireguard
when: enabled_wireguard is defined
systemd:
enabled: yes
name: "wg-quick@{{ item }}"
daemon_reload: yes
loop: "{{ enabled_wireguard }}"