]> git.openstreetmap.org Git - chef.git/blob - roles/db-master.rb
Bring stats.openstreetmap.org under chef control
[chef.git] / roles / db-master.rb
1 name "db-master"
2 description "Role applied to all the master database server"
3
4 default_attributes(
5   :postgresql => {
6     :versions => [ "9.1" ],
7     :settings => {
8       :defaults => {
9         :wal_level => "hot_standby",
10         :archive_mode => "on",
11         :archive_command => "/bin/cp %p /store/postgresql/system/archive/%f",
12         :max_wal_senders => "2",
13         :user_name_maps => {
14           :backup => [
15             { :system => "osmbackup", :postgres => "backup" }
16           ]
17         },
18         :early_authentication_rules => [
19           { :type => "local", :database => "all", :user => "backup", :method => "peer", :options => { :map => "backup" } }
20         ],
21         :late_authentication_rules => [
22           { :database => "replication", :user => "replication", :address => "146.179.159.168/32" }
23         ]
24       }
25     }
26   },
27   :rsyncd => {
28     :modules => {
29       :archive => {
30         :comment => "WAL Archive",
31         :path => "/store/postgresql/system/archive",
32         :read_only => true,
33         :write_only => false,
34         :list => false,
35         :uid => "postgres",
36         :gid => "postgres",
37         :transfer_logging => false,
38         :hosts_allow => [
39           "146.179.159.168"
40         ]
41       }
42     }
43   }
44 )
45
46 run_list(
47   "role[db]",
48   "recipe[db::master]",
49   "recipe[rsyncd]"
50 )