]> git.openstreetmap.org Git - chef.git/blob - roles/base.rb
Drop roles for thorn-02 and thorn-03
[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",
78       :parameters => {
79         "net.core.default_qdisc" => "fq"
80       }
81     },
82     :tune_cpu_scheduler => {
83       :comment => "Tune CPU scheduler for server scheduling",
84       :parameters => {
85         "kernel.sched_autogroup_enabled" => 0
86       }
87     }
88   }
89 )
90
91 run_list(
92   "recipe[accounts]",
93   "recipe[apt]",
94   "recipe[chef]",
95   "recipe[devices]",
96   "recipe[hardware]",
97   "recipe[prometheus]",
98   "recipe[munin::plugins]",
99   "recipe[networking]",
100   "recipe[exim]",
101   "recipe[ntp]",
102   "recipe[openssh]",
103   "recipe[sysctl]",
104   "recipe[sysfs]",
105   "recipe[tools]",
106   "recipe[fail2ban]"
107 )