]> git.openstreetmap.org Git - chef.git/blob - roles/base.rb
Attribution for lu_ngl_dtm
[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 }
24     },
25     :search => ["openstreetmap.org"]
26   },
27   :sysctl => {
28     :panic => {
29       :comment => "Reboot automatically after a panic",
30       :parameters => { "kernel.panic" => "60" }
31     },
32     :blackhole => {
33       :comment => "Do TCP level MTU probing if we seem to have an ICMP blackhole",
34       :parameters => {
35         "net.ipv4.tcp_mtu_probing" => "1",
36         "net.ipv4.tcp_base_mss" => "1024"
37       }
38     },
39     :network_buffers => {
40       :comment => "Tune network buffers",
41       :parameters => {
42         "net.core.rmem_max" => "16777216",
43         "net.core.wmem_max" => "16777216",
44         "net.ipv4.tcp_rmem" => "4096\t87380\t16777216",
45         "net.ipv4.tcp_wmem" => "4096\t65536\t16777216",
46         "net.ipv4.udp_mem" => "3145728\t4194304\t16777216"
47       }
48     },
49     :network_backlog => {
50       :comment => "Increase maximum backlog for incoming network packets",
51       :parameters => {
52         "net.core.netdev_max_backlog" => "2500",
53         "net.core.netdev_budget" => "600"
54       }
55     },
56     :network_conntrack_established => {
57       :comment => "Only track established connections for four hours",
58       :parameters => {
59         "net.netfilter.nf_conntrack_tcp_timeout_established" => "14400"
60       }
61     },
62     :tcp_syncookies => {
63       :comment => "Turn on syncookies to protect against SYN floods",
64       :parameters => {
65         "net.ipv4.tcp_syncookies" => "1"
66       }
67     },
68     :default_qdisc => {
69       :comment => "Use fq as the default queuing discipline and cubic for congestion control",
70       :parameters => {
71         "net.core.default_qdisc" => "fq",
72         "net.ipv4.tcp_congestion_control" => "cubic"
73       }
74     },
75     :tune_cpu_scheduler => {
76       :comment => "Tune CPU scheduler for server scheduling",
77       :parameters => {
78         "kernel.sched_migration_cost_ns" => 50000000,
79         "kernel.sched_autogroup_enabled" => 0
80       }
81     }
82   }
83 )
84
85 run_list(
86   "recipe[accounts]",
87   "recipe[apt]",
88   "recipe[chef]",
89   "recipe[devices]",
90   "recipe[hardware]",
91   "recipe[munin::plugins]",
92   "recipe[networking]",
93   "recipe[exim]",
94   "recipe[ntp]",
95   "recipe[openssh]",
96   "recipe[sysctl]",
97   "recipe[sysfs]",
98   "recipe[tools]",
99   "recipe[fail2ban]"
100 )