]> git.openstreetmap.org Git - chef.git/blob - roles/base.rb
Upgrade to postgres 14 on bowser
[chef.git] / roles / base.rb
1 name "base"
2 description "Base role applied to all servers"
3
4 default_attributes(
5   :accounts => {
6     :users => {
7       :grant => { :status => :administrator },
8       :tomh => { :status => :administrator },
9       :matt => { :status => :administrator },
10       :jburgess => { :status => :administrator }
11     }
12   },
13   :munin => {
14     :plugins => {
15       :chrony => {
16         :systime => { :warning => "100", :critical => "250" }
17       }
18     }
19   },
20   :networking => {
21     :roles => {
22       :internal => { :metric => 200, :zone => "loc" },
23       :external => { :metric => 100, :zone => "osm" }
24     },
25     :search => ["openstreetmap.org"]
26   },
27   :prometheus => {
28     :metrics => {
29       :exim_queue_limit => {
30         :help => "Mail queue alert level",
31         :metric => 50
32       }
33     }
34   },
35   :sysctl => {
36     :panic => {
37       :comment => "Reboot automatically after a panic",
38       :parameters => { "kernel.panic" => "60" }
39     },
40     :blackhole => {
41       :comment => "Do TCP level MTU probing if we seem to have an ICMP blackhole",
42       :parameters => {
43         "net.ipv4.tcp_mtu_probing" => "1",
44         "net.ipv4.tcp_base_mss" => "1024"
45       }
46     },
47     :network_buffers => {
48       :comment => "Tune network buffers",
49       :parameters => {
50         "net.core.rmem_max" => "16777216",
51         "net.core.wmem_max" => "16777216",
52         "net.ipv4.tcp_rmem" => "4096 87380 16777216",
53         "net.ipv4.tcp_wmem" => "4096 65536 16777216",
54         "net.ipv4.udp_mem" => "3145728 4194304 16777216"
55       }
56     },
57     :network_backlog => {
58       :comment => "Increase maximum backlog for incoming network packets",
59       :parameters => {
60         "net.core.netdev_max_backlog" => "2500",
61         "net.core.netdev_budget" => "600"
62       }
63     },
64     :network_conntrack_established => {
65       :comment => "Only track established connections for four hours",
66       :parameters => {
67         "net.netfilter.nf_conntrack_tcp_timeout_established" => "14400"
68       }
69     },
70     :tcp_syncookies => {
71       :comment => "Turn on syncookies to protect against SYN floods",
72       :parameters => {
73         "net.ipv4.tcp_syncookies" => "1"
74       }
75     },
76     :default_qdisc => {
77       :comment => "Use fq as the default queuing discipline and cubic for congestion control",
78       :parameters => {
79         "net.core.default_qdisc" => "fq",
80         "net.ipv4.tcp_congestion_control" => "cubic"
81       }
82     },
83     :tune_cpu_scheduler => {
84       :comment => "Tune CPU scheduler for server scheduling",
85       :parameters => {
86         "kernel.sched_autogroup_enabled" => 0
87       }
88     }
89   }
90 )
91
92 run_list(
93   "recipe[accounts]",
94   "recipe[apt]",
95   "recipe[chef]",
96   "recipe[devices]",
97   "recipe[hardware]",
98   "recipe[prometheus]",
99   "recipe[munin::plugins]",
100   "recipe[networking]",
101   "recipe[exim]",
102   "recipe[ntp]",
103   "recipe[openssh]",
104   "recipe[sysctl]",
105   "recipe[sysfs]",
106   "recipe[tools]",
107   "recipe[fail2ban]"
108 )