]> git.openstreetmap.org Git - chef.git/blob - roles/base.rb
Monitor all interfaces that are up and aren't the loopback interface
[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 => { "net.core.netdev_max_backlog" => "2500" }
55     },
56     :network_conntrack_established => {
57       :comment => "Only track established connections for four hours",
58       :parameters => {
59         "net.netfilter.nf_conntrack_tcp_timeout_established" => "14400"
60       }
61     },
62     :tcp_syncookies => {
63       :comment => "Turn on syncookies to protect against SYN floods",
64       :parameters => {
65         "net.ipv4.tcp_syncookies" => "1"
66       }
67     },
68     :default_qdisc => {
69       :comment => "Use pfifo_fast as the default queuing discipline",
70       :parameters => {
71         "net.core.default_qdisc" => "pfifo_fast"
72       }
73     }
74   },
75   :sysfs => {
76     :cpufreq_ondemand => {
77       :comment => "Tune the ondemand CPU frequency governor",
78       :parameters => {
79         "devices/system/cpu/cpufreq/ondemand/up_threshold" => "25",
80         "devices/system/cpu/cpufreq/ondemand/sampling_down_factor" => "100"
81       }
82     }
83   }
84 )
85
86 run_list(
87   "recipe[accounts]",
88   "recipe[apt]",
89   "recipe[chef]",
90   "recipe[devices]",
91   "recipe[hardware]",
92   "recipe[munin]",
93   "recipe[networking]",
94   "recipe[exim]",
95   "recipe[ntp]",
96   "recipe[openssh]",
97   "recipe[sysctl]",
98   "recipe[sysfs]",
99   "recipe[tools]",
100   "recipe[fail2ban]"
101 )