X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/261e7e9cd1a9882faa4ed7087b5902ebafe25988..32d9cf96efd24df9fca05725ad2a4de707cc029b:/cookbooks/nginx/definitions/nginx_site.rb diff --git a/cookbooks/nginx/definitions/nginx_site.rb b/cookbooks/nginx/definitions/nginx_site.rb index 528527b07..dc63df540 100644 --- a/cookbooks/nginx/definitions/nginx_site.rb +++ b/cookbooks/nginx/definitions/nginx_site.rb @@ -17,7 +17,7 @@ # limitations under the License. # -define :nginx_site, :action => [ :create ], :variables => {} do +define :nginx_site, :action => [:create], :variables => {} do name = params[:name] directory = params[:directory] || "/var/www/#{name}" site_action = params[:action] @@ -30,11 +30,9 @@ define :nginx_site, :action => [ :create ], :variables => {} do group "root" mode 0644 variables params[:variables].merge(:name => name, :directory => directory) - notifies :reload, "service[nginx]" + notifies :restart, "service[nginx]" end - end - - if site_action.include?(:delete) + elsif site_action.include?(:delete) file "/etc/nginx/conf.d/#{name}.conf" do action :delete notifies :restart, "service[nginx]"