+ mode 0o644
+ end
+
+ cookbook_file "/srv/#{name}/clientaccesspolicy.xml" do
+ source "clientaccesspolicy.xml"
+ user "root"
+ group "root"
+ mode 0o644
+ end
+
+ cookbook_file "/srv/#{name}/crossdomain.xml" do
+ source "crossdomain.xml"
+ user "root"
+ group "root"
+ mode 0o644
+ end
+
+ layers = Dir.glob("/srv/imagery/layers/#{name}/*.yml").collect do |path|
+ YAML.safe_load(::File.read(path), [Symbol])
+ end
+
+ template "/srv/#{name}/imagery.js" do
+ source "imagery.js.erb"
+ user "root"
+ group "root"
+ mode 0o644
+ variables :bbox => bbox, :layers => layers