]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/openvpn/recipes/default.rb
Fix some rubocop detected style issues
[chef.git] / cookbooks / openvpn / recipes / default.rb
index cbd45ee65c319efcb5ca224fe48e2cff67fe1f8a..b1955aa8c633c2d42c4fa5c56a4edc52b289a41c 100644 (file)
@@ -25,7 +25,7 @@ service "openvpn" do
   ignore_failure true
 end
 
-node[:openvpn][:tunnels].each do |name,details|
+node[:openvpn][:tunnels].each do |name, details|
   if peer = search(:node, "fqdn:#{details[:peer][:host]}").first
     if peer[:openvpn] and not details[:peer][:address]
       node.default[:openvpn][:tunnels][name][:peer][:address] = peer[:openvpn][:address]
@@ -46,7 +46,7 @@ node[:openvpn][:tunnels].each do |name,details|
       creates "/etc/openvpn/#{name}.key"
     end
 
-    if File.exists?("/etc/openvpn/#{name}.key")
+    if File.exist?("/etc/openvpn/#{name}.key")
       node.set[:openvpn][:keys][name] = IO.read("/etc/openvpn/#{name}.key")
     end
   elsif peer and peer[:openvpn]
@@ -69,7 +69,7 @@ node[:openvpn][:tunnels].each do |name,details|
       :port => node[:openvpn][:tunnels][name][:port],
       :mode => node[:openvpn][:tunnels][name][:mode],
       :peer => node[:openvpn][:tunnels][name][:peer]
-      notifies :restart, resources(:service => "openvpn")
+      notifies :restart, "service[openvpn]"
     end
   else
     file "/etc/openvpn/#{name}.conf" do