Skip to content

Commit 2832acb

Browse files
committed
Improved site removal, now works properly
1 parent a505124 commit 2832acb

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

providers/app.rb

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
action :add do
2-
service "nginx" do
3-
supports :status => true, :restart => true, :reload => true
4-
end
5-
62
template "#{node[:nginx][:dir]}/sites-available/#{new_resource.name}" do
73
cookbook "nginx"
84
source "proxy.conf.erb"
@@ -27,15 +23,14 @@
2723
end
2824

2925
def remove
30-
nginx_site new_resource.name do
31-
action :disable
32-
end
33-
34-
file "#{node[:nginx][:dir]}/sites-available/#{new_resource.name}" do
35-
action :delete
26+
bash "Delete nginx vhosts & logs for #{new_resource.name}" do
27+
code "rm -f #{node[:nginx][:log_dir]}/#{new_resource.name}* #{node[:nginx][:dir]}/sites*/#{new_resource.name}"
28+
notifies :reload, resources(:service => "nginx"), :delayed
3629
end
30+
end
3731

38-
bash "delete all nginx logs for #{new_resource.name}" do
39-
code "rm -f #{node[:nginx][:log_dir]}/#{new_resource.name}*"
32+
def load_current_resource
33+
service "nginx" do
34+
supports :reload => true
4035
end
4136
end

0 commit comments

Comments
 (0)