]> git.openstreetmap.org Git - chef.git/blob - roles/db.rb
foundation: use default mediawiki version
[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         :output_plugin_libraries => [
23           "osm-logical"
24         ],
25         :late_authentication_rules => [
26           { :address => "10.0.48.0/20" }, # amsterdam
27           { :address => "10.0.64.0/20" }, # dublin
28           { :database => "replication", :user => "replication", :address => "10.0.0.4/32" },   # snap-02
29           { :database => "replication", :user => "replication", :address => "10.0.0.10/32" },  # eddie
30           { :database => "replication", :user => "replication", :address => "10.0.48.49/32" }, # snap-01
31           { :database => "replication", :user => "replication", :address => "10.0.48.50/32" }, # karm
32           { :database => "replication", :user => "replication", :address => "10.0.64.50/32" }  # snap-03
33         ]
34       }
35     },
36     :pgbackrest => {
37       :credentials_bag => "db",
38       :credentials_item => "aws",
39       :repo_type => "s3",
40       :repo_path => "/",
41       :repo_cipher_type => "aes-256-cbc",
42       :repo_cipher_pass => "wal_encryption_key",
43       :repo_s3_bucket => "openstreetmap-wal-prod-85d400",
44       :repo_s3_endpoint => "s3.eu-north-1.amazonaws.com",
45       :repo_s3_key => "wal_prod_access_key_id",
46       :repo_s3_key_secret => "wal_prod_secret_access_key",
47       :repo_s3_region => "eu-north-1"
48     }
49   },
50   :sysctl => {
51     :swappiness => {
52       :comment => "Only swap in an emergency",
53       :parameters => {
54         "vm.swappiness" => 0
55       }
56     }
57   }
58 )