From: Tom Hughes Date: Tue, 31 Dec 2024 22:21:06 +0000 (+0000) Subject: Send traffic for RFC1918 addresses to the main routing table X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/HEAD?ds=sidebyside;hp=66e478e54a6fa9737402413c8eb919ae8ec64c7a Send traffic for RFC1918 addresses to the main routing table --- diff --git a/.kitchen.yml b/.kitchen.yml index 3e2206f7f..88cfc7459 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -1,7 +1,8 @@ --- driver: name: dokken - chef_version: 18 + chef_image: ghcr.io/firefishy/chef-docker-image + chef_version: latest volumes: - /var/lib/docker env: @@ -21,8 +22,6 @@ provisioner: name: dokken chef_license: accept data_bags_path: test/data_bags - chef_image: ghcr.io/firefishy/chef-docker-image:latest - chef_version: latest slow_resource_report: true clean_dokken_sandbox: true attributes: diff --git a/cookbooks/vectortile/recipes/default.rb b/cookbooks/vectortile/recipes/default.rb index 48b60f3c8..a8a78044c 100644 --- a/cookbooks/vectortile/recipes/default.rb +++ b/cookbooks/vectortile/recipes/default.rb @@ -250,7 +250,7 @@ template "/usr/local/bin/vector-update" do owner "root" group "root" mode "755" - variables :tilekiln_bin => "#{tilekiln_directory}/bin/tilekiln", :source_database => "spirit", :config_path => "#{shortbread_config}", :diff_size => "1000", :tiles_file => "/srv/vector.openstreetmap.org/data/tiles.txt", :post_processing => "/usr/local/bin/tiles-rerender" + variables :tilekiln_bin => "#{tilekiln_directory}/bin/tilekiln", :source_database => "spirit", :config_path => "#{shortbread_config}", :diff_size => "1000", :expiry_dir => "/srv/vector.openstreetmap.org/data/", :post_processing => "/usr/local/bin/tiles-rerender" end template "/usr/local/bin/tiles-rerender" do @@ -258,7 +258,7 @@ template "/usr/local/bin/tiles-rerender" do owner "root" group "root" mode "755" - variables :tilekiln_bin => "#{tilekiln_directory}/bin/tilekiln", :source_database => "spirit", :storage_database => "tiles", :config_path => "#{shortbread_config}", :tiles_file => "/srv/vector.openstreetmap.org/data/tiles.txt", :update_threads => 4 + variables :tilekiln_bin => "#{tilekiln_directory}/bin/tilekiln", :source_database => "spirit", :storage_database => "tiles", :config_path => "#{shortbread_config}", :expiry_dir => "/srv/vector.openstreetmap.org/data/", :update_threads => 4 end systemd_service "replicate" do diff --git a/cookbooks/vectortile/templates/default/import-planet.erb b/cookbooks/vectortile/templates/default/import-planet.erb index bffa34a3a..3d6110181 100644 --- a/cookbooks/vectortile/templates/default/import-planet.erb +++ b/cookbooks/vectortile/templates/default/import-planet.erb @@ -7,7 +7,7 @@ set -e -export LUA_PATH='/srv/vector.openstreetmap.org/osm2pgsql-themepark/lua/?.lua;/srv/vector.openstreetmap.org/spirit/?.lua;;' +export LUA_PATH='/srv/vector.openstreetmap.org/osm2pgsql-themepark/lua/?.lua;;' # Import the osm2pgsql file specified as an argument, using the locations for spirit osm2pgsql \ diff --git a/cookbooks/vectortile/templates/default/tiles-rerender.erb b/cookbooks/vectortile/templates/default/tiles-rerender.erb index f46b6f1f6..6c01b27f6 100644 --- a/cookbooks/vectortile/templates/default/tiles-rerender.erb +++ b/cookbooks/vectortile/templates/default/tiles-rerender.erb @@ -1,7 +1,11 @@ #!/bin/sh set -eu -<%= @tilekiln_bin %> generate tiles \ + +cd "<%= @expiry_dir %>" + +wc -l z*.txt +cat z*.txt | <%= @tilekiln_bin %> generate tiles \ --source-dbname "<%= @source_database %>" \ --storage-dbname "<%= @storage_database %>" \ --num-threads "<%= node[:vectortile][:replication][:threads] %>" \ ---config <%= @config_path %> < <%= @tiles_file %> +--config <%= @config_path %> diff --git a/cookbooks/vectortile/templates/default/vector-update-notile.erb b/cookbooks/vectortile/templates/default/vector-update-notile.erb index cd718789c..844d9d4fa 100644 --- a/cookbooks/vectortile/templates/default/vector-update-notile.erb +++ b/cookbooks/vectortile/templates/default/vector-update-notile.erb @@ -1,12 +1,13 @@ #!/bin/sh # Usage -# sudo -u tilekiln vector-update +# sudo -u tileupdate vector-update set -eu -export LUA_PATH='/srv/vector.openstreetmap.org/osm2pgsql-themepark/lua/?.lua;/srv/vector.openstreetmap.org/spirit/?.lua;;' +export LUA_PATH='/srv/vector.openstreetmap.org/osm2pgsql-themepark/lua/?.lua;;' +cd "<%= @expiry_dir %>" osm2pgsql-replication update \ -d "<%= @source_database %>" \ --max-diff-size "<%= @diff_size %>" diff --git a/cookbooks/vectortile/templates/default/vector-update-tile.erb b/cookbooks/vectortile/templates/default/vector-update-tile.erb index e59923b27..ba708c9b8 100644 --- a/cookbooks/vectortile/templates/default/vector-update-tile.erb +++ b/cookbooks/vectortile/templates/default/vector-update-tile.erb @@ -5,11 +5,10 @@ set -eu -export LUA_PATH='/srv/vector.openstreetmap.org/osm2pgsql-themepark/lua/?.lua;/srv/vector.openstreetmap.org/spirit/?.lua;;' +export LUA_PATH='/srv/vector.openstreetmap.org/osm2pgsql-themepark/lua/?.lua;;' +cd "<%= @expiry_dir %>" osm2pgsql-replication update \ -d "<%= @source_database %>" \ --max-diff-size "<%= @diff_size %>" \ - --post-processing "<%= @post_processing %>" \ - -- --expire-tiles=10-14 \ - --expire-output="<%= @tiles_file %>" + --post-processing "<%= @post_processing %>" diff --git a/roles/equinix-dub.rb b/roles/equinix-dub.rb index 6561d3019..9652c2c8c 100644 --- a/roles/equinix-dub.rb +++ b/roles/equinix-dub.rb @@ -24,6 +24,13 @@ default_attributes( }, :external => { :zone => "dub", + :inet => { + :rules => [ + { :to => "10.0.0.0/8", :table => "main", :priority => 50 }, + { :to => "172.16.0.0/12", :table => "main", :priority => 50 }, + { :to => "192.168.0.0/16", :table => "main", :priority => 50 } + ] + }, :inet6 => { :rules => [ { :to => "2600:9000::/28", :table => 150, :priority => 100 }