X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/21958591555b0b80370e944e3128ac5d533c281d..2e5da4c766bef71968e4c018751183ed31bd4633:/cookbooks/openvpn/recipes/default.rb diff --git a/cookbooks/openvpn/recipes/default.rb b/cookbooks/openvpn/recipes/default.rb index 9b01bfdb9..9b96183ee 100644 --- a/cookbooks/openvpn/recipes/default.rb +++ b/cookbooks/openvpn/recipes/default.rb @@ -26,7 +26,9 @@ service "openvpn" do end node[:openvpn][:tunnels].each do |name, details| - if peer = search(:node, "fqdn:#{details[:peer][:host]}").first + peer = search(:node, "fqdn:#{details[:peer][:host]}").first + + if peer if peer[:openvpn] && !details[:peer][:address] node.default[:openvpn][:tunnels][name][:peer][:address] = peer[:openvpn][:address] end