]> git.openstreetmap.org Git - chef.git/blob - roles/base.rb
Enable netplan support on eustace
[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   :apt => {
14     :sources => ["openstreetmap"]
15   },
16   :munin => {
17     :plugins => {
18       :ntp_offset => {
19         :offset => { :warning => "100", :critical => "250" }
20       }
21     }
22   },
23   :networking => {
24     :roles => {
25       :internal => { :metric => 200, :zone => "loc" },
26       :external => { :metric => 100 }
27     },
28     :search => ["openstreetmap.org"]
29   },
30   :sysctl => {
31     :panic => {
32       :comment => "Reboot automatically after a panic",
33       :parameters => { "kernel.panic" => "60" }
34     },
35     :blackhole => {
36       :comment => "Do TCP level MTU probing if we seem to have an ICMP blackhole",
37       :parameters => {
38         "net.ipv4.tcp_mtu_probing" => "1",
39         "net.ipv4.tcp_base_mss" => "1024"
40       }
41     },
42     :network_buffers => {
43       :comment => "Tune network buffers",
44       :parameters => {
45         "net.core.rmem_max" => "16777216",
46         "net.core.wmem_max" => "16777216",
47         "net.ipv4.tcp_rmem" => "4096\t87380\t16777216",
48         "net.ipv4.tcp_wmem" => "4096\t65536\t16777216",
49         "net.ipv4.udp_mem" => "3145728\t4194304\t16777216"
50       }
51     },
52     :network_backlog => {
53       :comment => "Increase maximum backlog for incoming network packets",
54       :parameters => {
55         "net.core.netdev_max_backlog" => "2500",
56         "net.core.netdev_budget" => "600"
57       }
58     },
59     :network_conntrack_established => {
60       :comment => "Only track established connections for four hours",
61       :parameters => {
62         "net.netfilter.nf_conntrack_tcp_timeout_established" => "14400"
63       }
64     },
65     :tcp_syncookies => {
66       :comment => "Turn on syncookies to protect against SYN floods",
67       :parameters => {
68         "net.ipv4.tcp_syncookies" => "1"
69       }
70     },
71     :default_qdisc => {
72       :comment => "Use pfifo_fast as the default queuing discipline",
73       :parameters => {
74         "net.core.default_qdisc" => "pfifo_fast"
75       }
76     }
77   },
78   :sysfs => {
79     :cpufreq_ondemand => {
80       :comment => "Tune the ondemand CPU frequency governor",
81       :parameters => {
82         "devices/system/cpu/cpufreq/ondemand/up_threshold" => "25",
83         "devices/system/cpu/cpufreq/ondemand/sampling_down_factor" => "100"
84       }
85     }
86   }
87 )
88
89 run_list(
90   "recipe[accounts]",
91   "recipe[apt]",
92   "recipe[chef]",
93   "recipe[devices]",
94   "recipe[hardware]",
95   "recipe[munin]",
96   "recipe[networking]",
97   "recipe[exim]",
98   "recipe[ntp]",
99   "recipe[openssh]",
100   "recipe[sysctl]",
101   "recipe[sysfs]",
102   "recipe[tools]",
103   "recipe[fail2ban]"
104 )