X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/e71e016abee9ae32dd357c4765bb7552d5455dde..cc3497871e61ab679624b47f54348b0694741357:/cookbooks/imagery/resources/layer.rb diff --git a/cookbooks/imagery/resources/layer.rb b/cookbooks/imagery/resources/layer.rb index dddd66522..8d9ffac14 100644 --- a/cookbooks/imagery/resources/layer.rb +++ b/cookbooks/imagery/resources/layer.rb @@ -59,4 +59,42 @@ action :create do subscribes :restart, "template[/srv/imagery/mapserver/layer-#{name}.map]" subscribes :restart, "template[/etc/init/mapserv-fgi-layer-#{name}.conf]" end + + directory "/srv/imagery/nginx/#{site}" do + owner "root" + group "root" + mode 0755 + recursive true + end + + template "/srv/imagery/nginx/#{site}/layer-#{name}.conf" do + cookbook "imagery" + source "nginx_imagery_layer_fragment.conf.erb" + owner "root" + group "root" + mode 0644 + variables new_resource.to_hash + notifies :reload, "service[nginx]", :delayed + end +end + +action :delete do + service "mapserv-fgi-layer-#{name}.conf" do + provider Chef::Provider::Service::Upstart + action [:stop, :disable] + supports :status => true, :restart => true, :reload => false + end + + file "/srv/imagery/mapserver/layer-#{name}.map" do + action :delete + end + + file "/etc/init/mapserv-fgi-layer-#{name}.conf" do + action :delete + end + + file "/srv/imagery/nginx/#{site}/layer-#{name}.conf" do + action :delete + notifies :reload, "service[nginx]", :delayed + end end