]> git.openstreetmap.org Git - chef.git/blob - cookbooks/planet/recipes/dump.rb
Install rubygems for the changeset replication script
[chef.git] / cookbooks / planet / recipes / dump.rb
1 #
2 # Cookbook Name:: planet
3 # Recipe:: dump
4 #
5 # Copyright 2013, OpenStreetMap Foundation
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19
20 include_recipe "git"
21
22 db_passwords = data_bag_item("db", "passwords")
23
24 package "gcc"
25 package "make"
26 package "libpqxx3-dev"
27
28 directory "/opt/planetdump" do
29   owner "root"
30   group "root"
31   mode 0755
32 end
33
34 git "/opt/planetdump" do
35   action :sync
36   repository "git://git.openstreetmap.org/planetdump.git"
37   revision "live"
38   user "root"
39   group "root"
40 end
41
42 execute "/opt/planetdump/Makefile" do
43   action :nothing
44   command "make planet06_pg"
45   cwd "/opt/planetdump"
46   user "root"
47   group "root"
48   subscribes :run, "git[/opt/planetdump]"
49 end
50
51 template "/usr/local/bin/planetdump" do
52   source "planetdump.erb"
53   owner "root"
54   group "root"
55   mode 0755
56   variables :password => db_passwords["planetdump"]
57 end
58
59 template "/etc/cron.d/planetdump" do
60   source "planetdump.cron.erb"
61   owner "root"
62   group "root"
63   mode 0644
64 end