Move wireguard clients configuration to home dir

Makes it easier to provision machines
This commit is contained in:
Jake Howard 2020-01-19 17:33:14 +00:00
parent 9ba8dab836
commit 35605ce0a6
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 8 additions and 7 deletions

View file

@ -0,0 +1,2 @@
user: jake
home: "/home/{{ user }}"

View file

@ -51,18 +51,17 @@
- name: Create wireguard client directory
file:
path: /etc/wireguard/clients
path: "{{ home }}/wireguard-clients"
state: directory
become: true
become_user: root
owner: "{{ user }}"
mode: 0700
- name: Wireguard client configuration
template:
src: files/wireguard-client.conf
dest: /etc/wireguard/clients/{{ item.key }}.conf
backup: yes
become: true
become_user: root
dest: "{{ home }}/wireguard-clients/{{ item.key }}.conf"
owner: "{{ user }}"
mode: 0600
loop: "{{ wireguard.clients|dict2items }}"
loop_control:
label: "{{ item.key }}"