diff --git a/defaults/main.yml b/defaults/main.yml index 7c31b845..e281f514 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -15,6 +15,9 @@ wireguard_port: "51820" # The default interface name that WireGuard should use if not specified otherwise. wireguard_interface: "wg0" +# The template for wg.conf file (default is provided with the role) +wireguard_conf_template: etc/wireguard/wg.conf.j2 + # The default owner of the wg.conf file wireguard_conf_owner: root diff --git a/tasks/main.yml b/tasks/main.yml index 42aa3ee6..60a6cd8e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -124,7 +124,7 @@ - name: Generate WireGuard configuration file ansible.builtin.template: - src: etc/wireguard/wg.conf.j2 + src: "{{ wireguard_conf_template }}" dest: "{{ wireguard_remote_directory }}/{{ wireguard_interface }}.conf" owner: "{{ wireguard_conf_owner }}" group: "{{ wireguard_conf_group }}"