diff --git a/.ansible/roles/linux_desktop/files/wireguard.conf b/.ansible/roles/linux_desktop/files/wireguard.conf new file mode 100644 index 0000000..c59c2c8 --- /dev/null +++ b/.ansible/roles/linux_desktop/files/wireguard.conf @@ -0,0 +1,10 @@ +[Interface] +PrivateKey = +Address = +PostUp = /usr/bin/systemd-resolve -i %i --set-dns= --set-domain=~. --set-domain= + +[Peer] +PublicKey = +PreSharedKey = +EndPoint = +AllowedIPs = 0.0.0.0/0 diff --git a/.ansible/roles/linux_desktop/tasks/config.yaml b/.ansible/roles/linux_desktop/tasks/config.yaml index fcae364..599a5cb 100644 --- a/.ansible/roles/linux_desktop/tasks/config.yaml +++ b/.ansible/roles/linux_desktop/tasks/config.yaml @@ -6,7 +6,7 @@ dest: "{{ item.dest }}" loop: "{{ config_repos }}" -- name: Conky configuration +- name: 'Conky: Configuration' tags: - config - conky @@ -14,3 +14,18 @@ src: 'templates/conkyrc.j2' dest: '~/.conkyrc' mode: '0600' + +- name: 'Wireguard: Configuration template' + tags: + - config + - wireguard + block: + - stat: + path: /etc/wireguard/wg0.conf + register: wgconfig + - copy: + dest: /etc/wireguard/wg0.conf + src: files/wireguard.conf + mode: '0400' + when: wgconfig.stat.exists == False + become: true