]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/profile/templates/wireguard/network.conf.erb
Add wireguard profile
[perso/Immae/Projets/Puppet.git] / modules / profile / templates / wireguard / network.conf.erb
diff --git a/modules/profile/templates/wireguard/network.conf.erb b/modules/profile/templates/wireguard/network.conf.erb
new file mode 100644 (file)
index 0000000..0528050
--- /dev/null
@@ -0,0 +1,13 @@
+[Interface]
+<%- @ips.each do |ip| %>
+Address = <%= ip %>
+<% end -%>
+PrivateKey = <%= @private_key %>
+
+<%- @facts["ldapvar"]["other"].each do |host| -%>
+<%- if (host["vars"]["wireguard_public"] || []).count > 0 %>
+[Peer]
+PublicKey = host["vars"]["wireguard_public"][0]
+
+<% end -%>
+<%- end -%>