]> git.openstreetmap.org Git - chef.git/blob - roles/base.rb
put pummelzacken in import mode
[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     :default_qdisc => {
68       :comment => "Use pfifo_fast as the default queuing discipline",
69       :parameters => {
70         "net.core.default_qdisc" => "pfifo_fast"
71       }
72     }
73   },
74   :sysfs => {
75     :cpufreq_ondemand => {
76       :comment => "Tune the ondemand CPU frequency governor",
77       :parameters => {
78         "devices/system/cpu/cpufreq/ondemand/up_threshold" => "25",
79         "devices/system/cpu/cpufreq/ondemand/sampling_down_factor" => "100"
80       }
81     }
82   }
83 )
84
85 run_list(
86   "recipe[accounts]",
87   "recipe[apt]",
88   "recipe[chef]",
89   "recipe[devices]",
90   "recipe[hardware]",
91   "recipe[munin]",
92   "recipe[networking]",
93   "recipe[exim]",
94   "recipe[ntp]",
95   "recipe[openssh]",
96   "recipe[sysctl]",
97   "recipe[sysfs]",
98   "recipe[tools]",
99   "recipe[fail2ban]"
100 )