echo "# user IDs < 286582 who have agreed to the contributor terms. " > $T/users_agreed
echo "# any active user IDs >= 286582 would have agreed as part of the sign-up process." >> $T/users_agreed
-psql -h ramoth.ic.openstreetmap.org -U planetdiff -t -c "select id from users where id < 286582 and terms_agreed is not null order by id asc" openstreetmap >> $T/users_agreed
+psql -h <%= node[:web][:readonly_database_host] %> -U planetdiff -t -c "select id from users where id < 286582 and terms_agreed is not null order by id asc" openstreetmap >> $T/users_agreed
-psql -h ramoth.ic.openstreetmap.org -U planetdiff -t -c "select id from users where terms_seen and terms_agreed is null order by id asc" openstreetmap > $T/users_disagreed
+psql -h <%= node[:web][:readonly_database_host] %> -U planetdiff -t -c "select id from users where terms_seen and terms_agreed is null order by id asc" openstreetmap > $T/users_disagreed
if cmp -s "${T}/users_agreed" "/store/planet/users_agreed/users_agreed.txt"; then
: # do nothing
state_file: /store/planet/replication/changesets/state.yaml
-db: host=katla.bm.openstreetmap.org dbname=openstreetmap user=planetdiff password=<%= @password %>
+db: host=<%= node[:web][:database_host] %> dbname=openstreetmap user=planetdiff password=<%= @password %>
data_dir: /store/planet/replication/changesets
# DO NOT EDIT - This file is being maintained by Chef
# The database host system
-host=katla.bm.openstreetmap.org
+host=<%= node[:web][:database_host] %>
# The database instance
database=openstreetmap
# DO NOT EDIT - This file is being maintained by Chef
-ramoth.ic.openstreetmap.org:5432:openstreetmap:planetdiff:<%= @password %>
+<%= node[:web][:readonly_database_host] %>:5432:openstreetmap:planetdiff:<%= @password %>
)
run_list(
+ "role[web-db]",
"recipe[planet]",
"recipe[planet::replication]",
"recipe[nfs::server]",
--- /dev/null
+name "web-db"
+description "Role applied to all servers needing to find the main database"
+
+default_attributes(
+ :web => {
+ :database_host => "katla.bm.openstreetmap.org",
+ :readonly_database_host => "ramoth.ic.openstreetmap.org"
+ }
+)
:pool_idle_time => 0
},
:web => {
- :status => "online",
- :database_host => "katla.bm.openstreetmap.org",
- :readonly_database_host => "ramoth.ic.openstreetmap.org"
+ :status => "online"
}
)
+
+run_list(
+ "role[web-db]"
+)