]> git.openstreetmap.org Git - chef.git/blob - roles/db.rb
Correct boolean constant
[chef.git] / roles / db.rb
1 name "db"
2 description "Role applied to all database servers"
3
4 default_attributes(
5   :apt => {
6     :unattended_upgrades => {
7       :enable => false
8     }
9   },
10   :postgresql => {
11     :settings => {
12       :defaults => {
13         :listen_addresses => "*",
14         :max_connections => "1500",
15         :max_stack_depth => "7MB",
16         :wal_level => "logical",
17         :max_wal_size => "1536MB",
18         :checkpoint_completion_target => "0.8",
19         :cpu_tuple_cost => "0.1",
20         :jit => "off",
21         :log_min_duration_statement => "1000",
22         :late_authentication_rules => [
23           { :address => "10.0.48.0/20" }, # amsterdam
24           { :address => "10.0.64.0/20" }, # dublin
25           { :database => "replication", :user => "replication", :address => "10.0.0.4/32" },   # snap-02
26           { :database => "replication", :user => "replication", :address => "10.0.0.10/32" },  # eddie
27           { :database => "replication", :user => "replication", :address => "10.0.48.49/32" }, # snap-01
28           { :database => "replication", :user => "replication", :address => "10.0.48.50/32" }, # karm
29           { :database => "replication", :user => "replication", :address => "10.0.64.50/32" }  # snap-03
30         ]
31       }
32     },
33     :pgbackrest => {
34       :credentials_bag => "db",
35       :credentials_item => "aws",
36       :repo_type => "s3",
37       :repo_path => "/",
38       :repo_cipher_type => "aes-256-cbc",
39       :repo_cipher_pass => "wal_encryption_key",
40       :repo_s3_bucket => "openstreetmap-wal-prod-85d400",
41       :repo_s3_endpoint => "s3.eu-north-1.amazonaws.com",
42       :repo_s3_key => "wal_prod_access_key_id",
43       :repo_s3_key_secret => "wal_prod_secret_access_key",
44       :repo_s3_region => "eu-north-1"
45     }
46   },
47   :sysctl => {
48     :swappiness => {
49       :comment => "Only swap in an emergency",
50       :parameters => {
51         "vm.swappiness" => 0
52       }
53     }
54   }
55 )