# limitations under the License.
#
+node.default[:ssl][:certificates] = node[:ssl][:certificates] | [ "tile.openstreetmap" ]
+
+include_recipe "ssl"
include_recipe "squid"
tilecaches = search(:node, "roles:tilecache").sort_by { |n| n[:hostname] }
-@tilecaches.each do |cache|
+tilecaches.each do |cache|
cache.ipaddresses(:family => :inet, :role => :external).sort.each do |address|
firewall_rule "accept-squid" do
action :accept
+ family "inet"
source "net:#{address}"
dest "fw"
proto "tcp:syn"
end
firewall_rule "accept-squid-icp" do
action :accept
+ family "inet"
source "net:#{address}"
dest "fw"
proto "udp"
template "squid.conf.erb"
variables :caches => tilecaches
end
+
+template "/etc/logrotate.d/squid" do
+ source "logrotate.squid.erb"
+ owner "root"
+ group "root"
+ mode 0644
+end
+