Move wireguard clients configuration to home dir
Makes it easier to provision machines
This commit is contained in:
parent
9ba8dab836
commit
35605ce0a6
2 changed files with 8 additions and 7 deletions
2
ansible/group_vars/all/user.yml
Normal file
2
ansible/group_vars/all/user.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
user: jake
|
||||||
|
home: "/home/{{ user }}"
|
|
@ -51,18 +51,17 @@
|
||||||
|
|
||||||
- name: Create wireguard client directory
|
- name: Create wireguard client directory
|
||||||
file:
|
file:
|
||||||
path: /etc/wireguard/clients
|
path: "{{ home }}/wireguard-clients"
|
||||||
state: directory
|
state: directory
|
||||||
become: true
|
owner: "{{ user }}"
|
||||||
become_user: root
|
mode: 0700
|
||||||
|
|
||||||
- name: Wireguard client configuration
|
- name: Wireguard client configuration
|
||||||
template:
|
template:
|
||||||
src: files/wireguard-client.conf
|
src: files/wireguard-client.conf
|
||||||
dest: /etc/wireguard/clients/{{ item.key }}.conf
|
dest: "{{ home }}/wireguard-clients/{{ item.key }}.conf"
|
||||||
backup: yes
|
owner: "{{ user }}"
|
||||||
become: true
|
mode: 0600
|
||||||
become_user: root
|
|
||||||
loop: "{{ wireguard.clients|dict2items }}"
|
loop: "{{ wireguard.clients|dict2items }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.key }}"
|
label: "{{ item.key }}"
|
||||||
|
|
Loading…
Reference in a new issue