Skip to content

Commit

Permalink
Implement the DNS Interface field. (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
JMLX42 authored Apr 14, 2021
1 parent 37e1b27 commit 54f4f12
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ debian_pin_packages: true

client_vpn_ip: ""
client_wireguard_path: "~/wg.conf"
client_wireguard_dns: false

wireguard_additional_peers: false
wireguard_post_up: false
Expand Down
3 changes: 3 additions & 0 deletions templates/client.conf.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[Interface]
Address = {{ client_vpn_ip }}
PrivateKey = {{ client_privatekey.content | b64decode | trim }}
{% if client_wireguard_dns %}
DNS = {{ client_wireguard_dns }}
{% endif %}

{% for node in play_hosts %}
[Peer]
Expand Down
3 changes: 3 additions & 0 deletions templates/interface.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ ListenPort = {{ wireguard_port }}
{% if wireguard_mtu is defined %}
MTU = {{ wireguard_mtu }}
{% endif %}
{% if client_wireguard_dns %}
DNS = {{ client_wireguard_dns }}
{% endif %}

{% for node in play_hosts %}
{% if inventory_hostname != hostvars[node]['inventory_hostname'] %}
Expand Down

0 comments on commit 54f4f12

Please sign in to comment.