]> git.openstreetmap.org Git - chef.git/blob - roles/db.rb
Write temporary data file to same disk as real one
[chef.git] / roles / db.rb
1 name "db"
2 description "Role applied to all database servers"
3
4 default_attributes(
5   :accounts => {
6     :users => {
7       :rails => {
8         :status => :role,
9         :members => [:tomh, :grant]
10       }
11     }
12   },
13   :apt => {
14     :unattended_upgrades => {
15       :enable => false
16     }
17   },
18   :munin => {
19     :plugins => {
20       :postgres_connections_openstreetmap => {
21         :waiting => {
22           :warning => 10,
23           :critical => 20
24         }
25       },
26       :postgres_locks_openstreetmap => {
27         :accesssharelock => {
28           :warning => 900,
29           :critical => 1000
30         },
31         :rowexclusivelock => {
32           :warning => 250,
33           :critical => 300
34         }
35       }
36     }
37   },
38   :nfs => {
39     "/store/rails" => { :host => "ironbelly", :path => "/store/rails" }
40   },
41   :postgresql => {
42     :versions => ["9.1"],
43     :settings => {
44       :defaults => {
45         :listen_addresses => "*",
46         :max_connections => "600",
47         :max_stack_depth => "7MB",
48         :checkpoint_segments => "32",
49         :max_wal_size => "1536MB",
50         :checkpoint_completion_target => "0.8",
51         :cpu_tuple_cost => "0.1",
52         :late_authentication_rules => [
53           { :address => "146.179.159.160/27" },
54           { :address => "10.0.16.0/20" },
55           { :address => "10.0.32.0/20" }
56         ]
57       }
58     }
59   },
60   :sysctl => {
61     :swappiness => {
62       :comment => "Only swap in an emergency",
63       :parameters => {
64         "vm.swappiness" => 0
65       }
66     }
67   }
68 )
69
70 run_list(
71   "recipe[nfs]"
72 )