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