]> git.openstreetmap.org Git - chef.git/blob - roles/base.rb
Remove munin
[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   :networking => {
14     :roles => {
15       :internal => { :metric => 200 },
16       :external => { :metric => 100 }
17     },
18     :search => ["openstreetmap.org"]
19   },
20   :prometheus => {
21     :metrics => {
22       :exim_queue_limit => {
23         :help => "Mail queue alert level",
24         :metric => 50
25       }
26     }
27   },
28   :sysctl => {
29     :panic => {
30       :comment => "Reboot automatically after a panic",
31       :parameters => { "kernel.panic" => "60" }
32     },
33     :blackhole => {
34       :comment => "Do TCP level MTU probing if we seem to have an ICMP blackhole",
35       :parameters => {
36         "net.ipv4.tcp_mtu_probing" => "1",
37         "net.ipv4.tcp_base_mss" => "1024"
38       }
39     },
40     :network_buffers => {
41       :comment => "Tune network buffers",
42       :parameters => {
43         "net.core.rmem_max" => "16777216",
44         "net.core.wmem_max" => "16777216",
45         "net.ipv4.tcp_rmem" => "4096 87380 16777216",
46         "net.ipv4.tcp_wmem" => "4096 65536 16777216",
47         "net.ipv4.udp_mem" => "3145728 4194304 16777216"
48       }
49     },
50     :network_backlog => {
51       :comment => "Increase maximum backlog for incoming network packets",
52       :parameters => {
53         "net.core.netdev_max_backlog" => "2500",
54         "net.core.netdev_budget" => "600"
55       }
56     },
57     :network_conntrack_established => {
58       :comment => "Only track established connections for four hours",
59       :parameters => {
60         "net.netfilter.nf_conntrack_tcp_timeout_established" => "14400"
61       }
62     },
63     :tcp_syncookies => {
64       :comment => "Turn on syncookies to protect against SYN floods",
65       :parameters => {
66         "net.ipv4.tcp_syncookies" => "1"
67       }
68     },
69     :default_qdisc => {
70       :comment => "Use fq as the default queuing discipline",
71       :parameters => {
72         "net.core.default_qdisc" => "fq"
73       }
74     },
75     :tune_cpu_scheduler => {
76       :comment => "Tune CPU scheduler for server scheduling",
77       :parameters => {
78         "kernel.sched_autogroup_enabled" => 0
79       }
80     }
81   }
82 )
83
84 run_list(
85   "recipe[accounts]",
86   "recipe[apt]",
87   "recipe[chef]",
88   "recipe[devices]",
89   "recipe[hardware]",
90   "recipe[prometheus]",
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 )