X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/3a4d52bd4c0f8e6ae7679145846b7bc7845d8ace..ee6580d55e1bbed06787ac3e5f18af1bb35c8e6d:/cookbooks/openvpn/recipes/default.rb diff --git a/cookbooks/openvpn/recipes/default.rb b/cookbooks/openvpn/recipes/default.rb index 3a0bcccf5..9b96183ee 100644 --- a/cookbooks/openvpn/recipes/default.rb +++ b/cookbooks/openvpn/recipes/default.rb @@ -20,13 +20,15 @@ package "openvpn" service "openvpn" do - action [ :enable, :start ] + action [:enable, :start] supports :status => true, :restart => true, :reload => true ignore_failure true 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