]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/imagery/resources/site.rb
Restart nginx after an imagery_site is updated
[chef.git] / cookbooks / imagery / resources / site.rb
index 76f6ca13def8c6d835ce4f2417027b98575f87bf..3edeb90385e03ef41807a17b188ce9057206d42b 100644 (file)
@@ -22,16 +22,20 @@ default_action :create
 property :name, String
 
 action :create do
-
   directory "/srv/imagery/#{name}" do
     owner "root"
     group "root"
     mode 0755
   end
 
-  nginx_site "#{name}" do
+  nginx_site name do
     template "nginx_imagery.conf.erb"
     directory "/srv/imagery/#{name}"
+    restart_nginx false
     variables new_resource.to_hash
   end
 end
+
+def after_created
+  notifies :restart, "service[nginx]"
+end