]> git.openstreetmap.org Git - chef.git/commitdiff
nginx: reload instead of restart on most config changes
authorGrant Slater <git@firefishy.com>
Mon, 20 Apr 2020 00:48:14 +0000 (01:48 +0100)
committerGrant Slater <git@firefishy.com>
Mon, 20 Apr 2020 00:48:14 +0000 (01:48 +0100)
cookbooks/imagery/recipes/default.rb
cookbooks/imagery/resources/site.rb
cookbooks/nginx/resources/site.rb

index b959804f1f5477a74cdaba1607c6d2559f0cdd39..961216f9d8b1a5e27404560003578e1d8991e4af 100644 (file)
@@ -82,7 +82,7 @@ end
 nginx_site "default" do
   template "nginx_default.conf.erb"
   directory "/srv/imagery/default"
 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
 end
 
 systemd_tmpfile "/run/mapserver-fastcgi" do
index b9cd7ece95efaf01d2139e4519faec82fea0125d..dc819ebf99fd6c190af551bca00bd962664bb105 100644 (file)
@@ -137,7 +137,7 @@ action :create do
   nginx_site new_resource.site do
     template "nginx_imagery.conf.erb"
     directory "/srv/imagery/#{new_resource.site}"
   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
     variables new_resource.to_hash
   end
 end
index 3c47d3091ebfd5b6fc76ccb2b2b5f73f9eeafd4b..8ac81adcff402ca4401c815646b7a90cc5a5cec5 100644 (file)
@@ -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 :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
 
 action :create do
   declare_resource :template, conf_path do
@@ -54,5 +54,5 @@ action_class do
 end
 
 def after_created
 end
 
 def after_created
-  notifies :restart, "service[nginx]" if restart_nginx
+  notifies :reload, "service[nginx]" if reload_nginx
 end
 end