X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/21958591555b0b80370e944e3128ac5d533c281d..ee6580d55e1bbed06787ac3e5f18af1bb35c8e6d:/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