apache_module "cache_disk"
apache_module "headers"
-template "/etc/cron.d/taginfo" do
- source "cron.erb"
- owner "root"
- group "root"
- mode 0o644
+file "/etc/cron.d/taginfo" do
+ action :delete
end
directory "/var/log/taginfo" do
mode 0o755
end
-file "/etc/logrotate.d/taginfo" do
- action :delete
-end
-
template "/etc/sudoers.d/taginfo" do
source "sudoers.erb"
owner "root"
settings["opensearch"]["contact"] = "webmaster@openstreetmap.org"
settings["sources"]["download"] = ""
settings["sources"]["create"] = "db languages projects wiki"
- settings["sources"]["db"]["planetfile"] = "#{directory}/planet/planet.pbf"
+ settings["sources"]["db"]["planetfile"] = "/var/lib/planet/planet.pbf"
settings["sources"]["db"]["bindir"] = "#{directory}/taginfo/tagstats"
settings["tagstats"]["geodistribution"] = "DenseMmapArray"
end
end
- remote_file "#{directory}/planet/planet.pbf" do
- action :create_if_missing
- source "https://planet.openstreetmap.org/pbf/planet-latest.osm.pbf"
- owner "taginfo"
- group "taginfo"
- mode 0o644
- end
-
- template "#{directory}/bin/update-planet" do
- source "update-planet.erb"
- owner "taginfo"
- group "taginfo"
- mode 0o755
- variables :directory => directory
+ file "#{directory}/bin/update-planet" do
+ action :delete
end
- template "#{directory}/bin/update-taginfo" do
- source "update-taginfo.erb"
- owner "taginfo"
- group "taginfo"
- mode 0o755
- variables :directory => directory
+ file "#{directory}/bin/update-taginfo" do
+ action :delete
end
template "#{directory}/bin/update" do
variables :aliases => site_aliases
end
end
+
+template "/usr/local/bin/taginfo-update" do
+ source "taginfo-update.erb"
+ owner "root"
+ group "root"
+ mode 0o755
+ variables :sites => node[:taginfo][:sites]
+end
+++ /dev/null
-# DO NOT EDIT - This file is being maintained by Chef
-
-baseUrl=https://planet.openstreetmap.org/replication/hour
-maxInterval=0
+++ /dev/null
-# DO NOT EDIT - This file is being maintained by Chef
-
-<% node[:taginfo][:sites].each do |site| -%>
-<% if site[:directory] -%>
-17 1 * * * taginfo <%= site[:directory] %>/bin/update
-<% else -%>
-17 1 * * * taginfo /srv/<%= site[:name] %>/bin/update
-<% end -%>
-<% end -%>
+++ /dev/null
-# DO NOT EDIT - This file is being maintained by Chef
-<% node[:taginfo][:sites].each do |site| -%>
-
-/var/log/taginfo/<%= site[:name] %>/*.log {
- daily
- missingok
- rotate 0
- dateext
- dateformat %Y-%m-%d
- maxage 28
- compress
- delaycompress
-}
-<% end -%>
--- /dev/null
+#!/bin/sh
+
+# DO NOT EDIT - This file is being maintained by Chef
+
+<% @sites.each do |site| -%>
+<% if site[:directory] -%>
+<%= site[:directory] %>/bin/update
+<% else -%>
+/srv/<%= site[:name] %>/bin/update
+<% end -%>
+<% end -%>
+++ /dev/null
-#!/bin/sh
-
-# DO NOT EDIT - This file is being maintained by Chef
-
-# setup
-
-PLANETDIR="<%= @directory %>/planet"
-LOGDIR="${PLANETDIR}/log"
-PLANETPREV="${PLANETDIR}/planet-previous.pbf"
-PLANETCURR="${PLANETDIR}/planet.pbf"
-PLANETNEW="${PLANETDIR}/planet-new.pbf"
-PLANETTMP="${PLANETDIR}/planet-tmp.pbf"
-
-# start logging
-
-exec > "${LOGDIR}/$(date +%Y%m%d-%H%M).log" 2>&1
-
-pyosmium-up-to-date -v -o $PLANETNEW $PLANETCURR
-retval=$?
-
-while [ $retval -eq 1 ]; do
- mv "$PLANETNEW" "$PLANETTMP"
- pyosmium-up-to-date -v -o $PLANETNEW $PLANETTMP
- retval=$?
- rm "$PLANETTMP"
-done
-
-if [ $retval -ne 0 ]; then
- exit $retval
-fi
-
-# cleanup
-
-mv "$PLANETCURR" "$PLANETPREV"
-mv "$PLANETNEW" "$PLANETCURR"
-
-# expire old logs
-
-find "${LOGDIR}" -mtime +28 -delete
+++ /dev/null
-#!/bin/sh
-
-# DO NOT EDIT - This file is being maintained by Chef
-
-set -e
-
-ROOT="<%= @directory %>"
-
-cd $ROOT/taginfo/sources
-
-if [ -f "$ROOT/data/taginfo-history.db" ]
-then
- cp $ROOT/data/taginfo-history.db $ROOT/sources
-fi
-
-$ROOT/taginfo/sources/update_all.sh $ROOT/sources
-
-mv $ROOT/data/taginfo-* $ROOT/data/old
-mv $ROOT/sources/taginfo-*.db $ROOT/sources/*/taginfo-*.db $ROOT/data
-mv $ROOT/sources/download/* $ROOT/download
-
-sudo PASSENGER_INSTANCE_REGISTRY_DIR=<%= node[:passenger][:instance_registry_dir] %> /usr/bin/passenger-config restart-app $ROOT/taginfo/web > /dev/null
-
-find $ROOT/sources/log -mtime +28 -delete
# DO NOT EDIT - This file is being maintained by Chef
-<%= @directory %>/bin/update-planet
-<%= @directory %>/bin/update-taginfo
+set -e
+
+ROOT="<%= @directory %>"
+
+cd $ROOT/taginfo/sources
+
+if [ -f "$ROOT/data/taginfo-history.db" ]
+then
+ cp $ROOT/data/taginfo-history.db $ROOT/sources
+fi
+
+$ROOT/taginfo/sources/update_all.sh $ROOT/sources
+
+mv $ROOT/data/taginfo-* $ROOT/data/old
+mv $ROOT/sources/taginfo-*.db $ROOT/sources/*/taginfo-*.db $ROOT/data
+mv $ROOT/sources/download/* $ROOT/download
+
+sudo PASSENGER_INSTANCE_REGISTRY_DIR=<%= node[:passenger][:instance_registry_dir] %> /usr/bin/passenger-config restart-app $ROOT/taginfo/web > /dev/null
+
+find $ROOT/sources/log -mtime +28 -delete
find "/var/log/taginfo/<%= @name %>" -mtime +28 -delete
:passenger => {
:max_pool_size => 50
},
+ :planet => {
+ :current => {
+ :taginfo => {
+ :command => "/usr/local/bin/taginfo-update",
+ :user => "taginfo"
+ }
+ }
+ },
:taginfo => {
:sites => [
{
)
run_list(
+ "recipe[planet::current]",
"recipe[taginfo]"
)