X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/8cf8bc46f84f00674ceaefcbe46a6d3edb1db49d..f7628dac50cd43cd44bb4f7e5c343fe990b5af3f:/cookbooks/networking/templates/default/wireguard.network.erb diff --git a/cookbooks/networking/templates/default/wireguard.network.erb b/cookbooks/networking/templates/default/wireguard.network.erb index 2d3469cf1..a3b7dd115 100644 --- a/cookbooks/networking/templates/default/wireguard.network.erb +++ b/cookbooks/networking/templates/default/wireguard.network.erb @@ -1,15 +1,21 @@ [Match] Name=wg0 +[Link] +RequiredForOnline=no + [Network] <% if node.internal_ipaddress -%> Address=<%= node.internal_ipaddress %>/32 <% end -%> +<% if node[:networking][:private_address] -%> +Address=<%= node[:networking][:private_address] %>/32 +<% end -%> Address=<%= node[:networking][:wireguard][:address] %>/128 [Route] Destination=fd43:e709:ea6d:1::/64 -<% node[:networking][:wireguard][:peers].each do |peer| -%> +<% node[:networking][:wireguard][:peers].sort_by { |p| p[:public_key] }.each do |peer| -%> <% Array(peer[:allowed_ips]).sort.each do |ip| -%> <% unless ip =~ /^fd43:e709:ea6d:1::/ -%>