]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blame - modules/profile/templates/wireguard/network.conf.erb
Add wireguard to host_ldap
[perso/Immae/Projets/Puppet.git] / modules / profile / templates / wireguard / network.conf.erb
CommitLineData
7f8c6327 1[Interface]
cfad7610 2<%- @ips.each do |ip| -%>
7f8c6327 3Address = <%= ip %>
cfad7610 4<%- end -%>
7f8c6327 5PrivateKey = <%= @private_key %>
cfad7610 6ListenPort = 51820
7f8c6327
IB
7
8<%- @facts["ldapvar"]["other"].each do |host| -%>
9<%- if (host["vars"]["wireguard_public"] || []).count > 0 %>
10[Peer]
cfad7610
IB
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
7f8c6327
IB
17
18<% end -%>
19<%- end -%>