]> git.openstreetmap.org Git - chef.git/blob - roles/db-master.rb
Drop help.apis.dev.openstreetmap.org
[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/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           { :database => "replication", :user => "replication", :address => "146.179.159.173/32" }
24         ]
25       }
26     }
27   },
28   :rsyncd => {
29     :modules => {
30       :archive => {
31         :comment => "WAL Archive",
32         :path => "/store/postgresql/system/archive",
33         :read_only => true,
34         :write_only => false,
35         :list => false,
36         :uid => "postgres",
37         :gid => "postgres",
38         :transfer_logging => false,
39         :hosts_allow => [
40           "146.179.159.168", "146.179.159.173"
41         ]
42       }
43     }
44   }
45 )
46
47 run_list(
48   "role[db]",
49   "recipe[db::master]",
50   "recipe[rsyncd]"
51 )