]> git.openstreetmap.org Git - chef.git/commitdiff
Force upgrade of squid to 4.9 on tile caches
authorTom Hughes <tom@compton.nu>
Wed, 1 Jan 2020 14:05:15 +0000 (14:05 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 1 Jan 2020 14:15:37 +0000 (14:15 +0000)
cookbooks/tilecache/recipes/default.rb

index 63de8a529f92a3b85802077c3161d2e14fb18f91..395ee54dcdd8106240026b122447a12096c1fad5 100644 (file)
@@ -100,6 +100,25 @@ squid_fragment "tilecache" do
   variables :caches => tilecaches, :renders => tilerenders
 end
 
+if node[:packages][:squid][:version].to_f < 4.9
+  Array(node[:squid][:cache_dir]).each do |cache_dir|
+    if cache_dir =~ /^coss (\S+) /
+      cache_dir = File.dirname(Regexp.last_match(1))
+    elsif cache_dir =~ /^\S+ (\S+) /
+      cache_dir = Regexp.last_match(1)
+    end
+
+    file "#{cache_dir}/rock" do
+      action :delete
+      backup false
+    end
+  end
+
+  package "squid" do
+    action :upgrade
+  end
+end
+
 package "rsync"
 
 template "/etc/logrotate.d/squid" do