summaryrefslogtreecommitdiffstats
path: root/roles/wireguard/templates/wg.conf.j2
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2019-02-19 05:45:25 +0100
committerTharre <tharre3@gmail.com>2019-02-19 05:45:30 +0100
commitb6d02e11cc8ac63ce717f1a9be092f1f541745b6 (patch)
treee999059e1eefd7d05c7040a8581187cad8be5dd6 /roles/wireguard/templates/wg.conf.j2
parentcbd109adc0822485431fa64e4d552facf05ad02b (diff)
downloadinfrastructure-b6d02e11cc8ac63ce717f1a9be092f1f541745b6.tar.gz
infrastructure-b6d02e11cc8ac63ce717f1a9be092f1f541745b6.tar.xz
infrastructure-b6d02e11cc8ac63ce717f1a9be092f1f541745b6.zip
Add WireGuard role
Diffstat (limited to 'roles/wireguard/templates/wg.conf.j2')
-rw-r--r--roles/wireguard/templates/wg.conf.j237
1 files changed, 37 insertions, 0 deletions
diff --git a/roles/wireguard/templates/wg.conf.j2 b/roles/wireguard/templates/wg.conf.j2
new file mode 100644
index 0000000..bac19a9
--- /dev/null
+++ b/roles/wireguard/templates/wg.conf.j2
@@ -0,0 +1,37 @@
+[Interface]
+{% for addr in item.address %}
+Address = {{ addr }}
+{% endfor %}
+{% if item.dns is defined %}
+DNS = {{ item.dns }}
+{% endif %}
+{% if item.preUp is defined %}
+PreUp = {{ item.preUp }}
+{% endif %}
+{% if item.preDown is defined %}
+PreDown = {{ item.preDown }}
+{% endif %}
+{% if item.postUp is defined %}
+PostUp = {{ item.postUp }}
+{% endif %}
+{% if item.postDown is defined %}
+PostDown = {{ item.postDown }}
+{% endif %}
+ListenPort = {{ item.port }}
+PrivateKey = {{ item.privateKey }}
+{% if item.fwmark is defined %}
+Fwmark = {{ item.fwmark }}
+{% endif %}
+
+{% for peer in item.peers %}
+[Peer]
+PublicKey = {{ peer.publicKey }}
+{% if peer.presharedKey is defined %}
+PresharedKey = {{ peer.presharedKey }}
+{% endif %}
+AllowedIPs = {{ peer.allowedIPs }}
+{% if peer.persistentKeepalive is defined %}
+PersistentKeepalive = {{ peer.persistentKeepalive }}
+{% endif %}
+
+{% endfor %}