From 86dd0e99c6342b5dc6a236ba1da80ad18c8f3aab Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 20 Apr 2020 01:48:14 +0100 Subject: [PATCH] nginx: reload instead of restart on most config changes --- cookbooks/imagery/recipes/default.rb | 2 +- cookbooks/imagery/resources/site.rb | 2 +- cookbooks/nginx/resources/site.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cookbooks/imagery/recipes/default.rb b/cookbooks/imagery/recipes/default.rb index b959804f1..961216f9d 100644 --- a/cookbooks/imagery/recipes/default.rb +++ b/cookbooks/imagery/recipes/default.rb @@ -82,7 +82,7 @@ end nginx_site "default" do template "nginx_default.conf.erb" directory "/srv/imagery/default" - restart_nginx false + reload_nginx false end systemd_tmpfile "/run/mapserver-fastcgi" do diff --git a/cookbooks/imagery/resources/site.rb b/cookbooks/imagery/resources/site.rb index b9cd7ece9..dc819ebf9 100644 --- a/cookbooks/imagery/resources/site.rb +++ b/cookbooks/imagery/resources/site.rb @@ -137,7 +137,7 @@ action :create do nginx_site new_resource.site do template "nginx_imagery.conf.erb" directory "/srv/imagery/#{new_resource.site}" - restart_nginx false + reload_nginx false variables new_resource.to_hash end end diff --git a/cookbooks/nginx/resources/site.rb b/cookbooks/nginx/resources/site.rb index 3c47d3091..8ac81adcf 100644 --- a/cookbooks/nginx/resources/site.rb +++ b/cookbooks/nginx/resources/site.rb @@ -24,7 +24,7 @@ property :directory, :kind_of => String property :cookbook, :kind_of => String property :template, :kind_of => String, :required => true property :variables, :kind_of => Hash, :default => {} -property :restart_nginx, :kind_of => [TrueClass, FalseClass], :default => true +property :reload_nginx, :kind_of => [TrueClass, FalseClass], :default => true action :create do declare_resource :template, conf_path do @@ -54,5 +54,5 @@ action_class do end def after_created - notifies :restart, "service[nginx]" if restart_nginx + notifies :reload, "service[nginx]" if reload_nginx end -- 2.43.2