Optimized wireguard roles

This commit is contained in:
2023-04-18 18:24:55 +02:00
parent 9f1a4c6fdb
commit 1e5b9317d7
17 changed files with 54 additions and 71 deletions

View File

@@ -0,0 +1,27 @@
- name: install wireguard for Arch
pacman:
name: wireguard-tools
state: present
when: ansible_os_family == "Archlinux"
- name: install wireguard for Ubuntu
apt:
name: wireguard
state: present
when: ansible_os_family == "Debian"
- name: create wireguard-ip.conf
copy:
src: "wireguard-ip.conf"
dest: /etc/sysctl.d/wireguard-ip.conf
owner: root
group: root
notify: reload sysctl configuration
- name: create /etc/wireguard/wg0.conf
copy:
src: "{{ inventory_dir }}/files/{{ inventory_hostname }}/etc/wireguard/wg0.conf"
dest: /etc/wireguard/wg0.conf
owner: root
group: root
notify: restart wireguard