Skip to content

Commit 54f4f12

Browse files
authored
Implement the DNS Interface field. (#34)
1 parent 37e1b27 commit 54f4f12

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ debian_pin_packages: true
1111

1212
client_vpn_ip: ""
1313
client_wireguard_path: "~/wg.conf"
14+
client_wireguard_dns: false
1415

1516
wireguard_additional_peers: false
1617
wireguard_post_up: false

templates/client.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[Interface]
22
Address = {{ client_vpn_ip }}
33
PrivateKey = {{ client_privatekey.content | b64decode | trim }}
4+
{% if client_wireguard_dns %}
5+
DNS = {{ client_wireguard_dns }}
6+
{% endif %}
47

58
{% for node in play_hosts %}
69
[Peer]

templates/interface.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ ListenPort = {{ wireguard_port }}
1111
{% if wireguard_mtu is defined %}
1212
MTU = {{ wireguard_mtu }}
1313
{% endif %}
14+
{% if client_wireguard_dns %}
15+
DNS = {{ client_wireguard_dns }}
16+
{% endif %}
1417

1518
{% for node in play_hosts %}
1619
{% if inventory_hostname != hostvars[node]['inventory_hostname'] %}

0 commit comments

Comments
 (0)