6 PrivateKeyFile=/var/lib/systemd/wireguard/private.key
8 <% node[:networking][:wireguard][:peers].sort_by { |p| p[:public_key] }.each do |peer| -%>
11 PublicKey=<%= peer[:public_key] %>
12 PresharedKeyFile=/var/lib/systemd/wireguard/preshared.key
13 AllowedIPs=<%= Array(peer[:allowed_ips]).sort.join(",") %>
14 <% if peer[:endpoint] -%>
15 Endpoint=<%= peer[:endpoint] %>
17 <% if node[:networking][:wireguard][:keepalive] -%>
18 PersistentKeepalive=<%= node[:networking][:wireguard][:keepalive] %>