From: Tom Hughes Date: Fri, 17 May 2024 15:56:39 +0000 (+0100) Subject: Make the location of the replication state directory configurable X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/47b2533386f29c3d3424bb3fcc5ff834f5fde16f Make the location of the replication state directory configurable --- diff --git a/cookbooks/tile/attributes/default.rb b/cookbooks/tile/attributes/default.rb index 776e274b0..cc5803d00 100644 --- a/cookbooks/tile/attributes/default.rb +++ b/cookbooks/tile/attributes/default.rb @@ -8,6 +8,7 @@ default[:tile][:database][:tag_transform_script] = nil default[:tile][:mapnik] = "3.1" +default[:tile][:replication][:directory] = "/var/lib/replicate" default[:tile][:replication][:url] = "https://osm-planet-eu-central-1.s3.dualstack.eu-central-1.amazonaws.com/planet/replication/minute" default[:tile][:data] = {} diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 0c9da1339..a05cd0fd9 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -514,12 +514,19 @@ package %w[ pyosmium ] -directory "/var/lib/replicate" do +directory node[:tile][:replication][:directory] do owner "tile" group "tile" mode "755" end +link "/var/lib/replicate" do + to node[:tile][:replication][:directory] + owner "tile" + group "tile" + not_if { node[:tile][:replication][:directory] == "/var/lib/replicate" } +end + template "/usr/local/bin/expire-tiles" do source "expire-tiles.erb" owner "root"