- subscribes :restart, "template[/srv/imagery/mapserver/layer-#{name}.map]"
- subscribes :restart, "template[/etc/init/mapserv-fgi-layer-#{name}.conf]"
+ subscribes :restart, "template[/srv/imagery/mapserver/layer-#{layer}.map]"
+ subscribes :restart, "template[/etc/init/mapserv-fcgi-layer-#{layer}.conf]"
+ end
+
+ directory "/srv/imagery/nginx/#{site}" do
+ owner "root"
+ group "root"
+ mode 0755
+ recursive true
+ end
+
+ template "/srv/imagery/nginx/#{site}/layer-#{layer}.conf" do
+ cookbook "imagery"
+ source "nginx_imagery_layer_fragment.conf.erb"
+ owner "root"
+ group "root"
+ mode 0644
+ variables new_resource.to_hash
+ end
+end
+
+action :delete do
+ service "mapserv-fcgi-layer-#{layer}" do
+ provider Chef::Provider::Service::Upstart
+ action [:stop, :disable]
+ supports :status => true, :restart => true, :reload => false
+ end
+
+ file "/srv/imagery/mapserver/layer-#{layer}.map" do
+ action :delete
+ end
+
+ file "/etc/init/mapserv-fcgi-layer-#{layer}.conf" do
+ action :delete
+ end
+
+ file "/srv/imagery/nginx/#{site}/layer-#{layer}.conf" do
+ action :delete