aboutsummaryrefslogtreecommitdiff
path: root/modules/profile/templates/wireguard/network.conf.erb
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-08-18 19:30:29 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-08-18 19:30:29 +0200
commited7b09a7b7c88c49e4fddb8cbe49e6a4ce6bce10 (patch)
tree3819efff8336fdda1fef8fc78fd2fbc0791693af /modules/profile/templates/wireguard/network.conf.erb
parentb84916dd6c1bd5db098ecdd86f3f60ce22d1c1d6 (diff)
parent6667f52e8017065c9b5f14c8025458b38029a800 (diff)
downloadPuppet-ed7b09a7b7c88c49e4fddb8cbe49e6a4ce6bce10.tar.gz
Puppet-ed7b09a7b7c88c49e4fddb8cbe49e6a4ce6bce10.tar.zst
Puppet-ed7b09a7b7c88c49e4fddb8cbe49e6a4ce6bce10.zip
Merge branch 'dev'
Diffstat (limited to 'modules/profile/templates/wireguard/network.conf.erb')
-rw-r--r--modules/profile/templates/wireguard/network.conf.erb19
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/profile/templates/wireguard/network.conf.erb b/modules/profile/templates/wireguard/network.conf.erb
new file mode 100644
index 0000000..5327dfd
--- /dev/null
+++ b/modules/profile/templates/wireguard/network.conf.erb
@@ -0,0 +1,19 @@
1[Interface]
2<%- @ips.each do |ip| -%>
3Address = <%= ip %>
4<%- end -%>
5PrivateKey = <%= @private_key %>
6ListenPort = 51820
7
8<%- @facts["ldapvar"]["other"].each do |host| -%>
9<%- if (host["vars"]["wireguard_public"] || []).count > 0 %>
10[Peer]
11# <%= host["vars"]["real_hostname"][0] %>
12PublicKey = <%= host["vars"]["wireguard_public"][0] %>
13<%- if (host["vars"]["wireguard_ip"] || []).count > 0 -%>
14AllowedIps = <%= host["vars"]["wireguard_ip"].join(", ").gsub /\/\d+/, "/32" %>
15<%- end -%>
16Endpoint = <%= host["vars"]["real_hostname"][0] %>:51820
17
18<% end -%>
19<%- end -%>