]> git.openstreetmap.org Git - chef.git/blob - roles/base.rb
Update bundle
[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       }
50     },
51     :network_backlog => {
52       :comment => "Increase maximum backlog for incoming network packets",
53       :parameters => { "net.core.netdev_max_backlog" => "2500" }
54     },
55     :network_conntrack_established => {
56       :comment => "Only track established connections for four hours",
57       :parameters => {
58         "net.netfilter.nf_conntrack_tcp_timeout_established" => "14400"
59       }
60     },
61     :tcp_syncookies => {
62       :comment => "Turn on syncookies to protect against SYN floods",
63       :parameters => {
64         "net.ipv4.tcp_syncookies" => "1"
65       }
66     }
67   },
68   :sysfs => {
69     :cpufreq_ondemand => {
70       :comment => "Tune the ondemand CPU frequency governor",
71       :parameters => {
72         "devices/system/cpu/cpufreq/ondemand/up_threshold" => "25",
73         "devices/system/cpu/cpufreq/ondemand/sampling_down_factor" => "100"
74       }
75     }
76   }
77 )
78
79 run_list(
80   "recipe[accounts]",
81   "recipe[apt]",
82   "recipe[chef]",
83   "recipe[devices]",
84   "recipe[hardware]",
85   "recipe[munin]",
86   "recipe[networking]",
87   "recipe[exim]",
88   "recipe[ntp]",
89   "recipe[openssh]",
90   "recipe[sysctl]",
91   "recipe[sysfs]",
92   "recipe[tools]",
93   "recipe[fail2ban]"
94 )