diff --git a/roles/svc-net-wireguard-core/tasks/main.yml b/roles/svc-net-wireguard-core/tasks/main.yml index 208a5419..1e974549 100644 --- a/roles/svc-net-wireguard-core/tasks/main.yml +++ b/roles/svc-net-wireguard-core/tasks/main.yml @@ -18,10 +18,10 @@ group: root notify: reload sysctl configuration -- name: create /etc/wireguard/wg0.{{ SOFTWARE_NAME | lower }}.conf +- name: "deploy {{ WG0_CONF_DEST }}" copy: - src: "{{ inventory_dir }}/files/{{ inventory_hostname }}/etc/wireguard/wg0.conf" - dest: /etc/wireguard/wg0.{{ SOFTWARE_NAME | lower }}.conf - owner: root - group: root + src: "{{ [inventory_dir, 'files', inventory_hostname, 'etc/wireguard/wg0.conf' ] | path_join }}" + dest: "{{ WG0_CONF_DEST }}" + owner: root + group: root notify: restart wireguard \ No newline at end of file diff --git a/roles/svc-net-wireguard-core/vars/main.yml b/roles/svc-net-wireguard-core/vars/main.yml index c5d85a2d..bda3b5ee 100644 --- a/roles/svc-net-wireguard-core/vars/main.yml +++ b/roles/svc-net-wireguard-core/vars/main.yml @@ -1 +1,3 @@ application_id: svc-net-wireguard-core + +WG0_CONF_DEST: "/etc/wireguard/wg0.conf" \ No newline at end of file