]> git.openstreetmap.org Git - chef.git/blob - roles/db.rb
Drop roles for thorn-02 and thorn-03
[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   :postgresql => {
39     :settings => {
40       :defaults => {
41         :listen_addresses => "*",
42         :max_connections => "1500",
43         :max_stack_depth => "7MB",
44         :checkpoint_segments => "32",
45         :max_wal_size => "1536MB",
46         :checkpoint_completion_target => "0.8",
47         :cpu_tuple_cost => "0.1",
48         :log_min_duration_statement => "1000",
49         :late_authentication_rules => [
50           { :address => "10.0.32.0/20" },
51           { :address => "10.0.48.0/20" },
52           { :address => "10.0.64.0/20" }
53         ]
54       }
55     }
56   },
57   :sysctl => {
58     :swappiness => {
59       :comment => "Only swap in an emergency",
60       :parameters => {
61         "vm.swappiness" => 0
62       }
63     }
64   }
65 )