]> git.openstreetmap.org Git - chef.git/blob - cookbooks/tools/recipes/default.rb
Sort list of tool packages
[chef.git] / cookbooks / tools / recipes / default.rb
1 #
2 # Cookbook:: tools
3 # Recipe:: default
4 #
5 # Copyright:: 2011, OpenStreetMap Foundation
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #     https://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19
20 package %w[
21   bash-completion
22   cron
23   dmidecode
24   ethtool
25   iotop
26   locales-all
27   lsof
28   lsscsi
29   lvm2
30   numactl
31   pciutils
32   rsyslog
33   screen
34   smartmontools
35   strace
36   sysstat
37   systemd-coredump
38   tcpdump
39   usbutils
40   vim
41   xfsprogs
42 ]
43
44 service "rsyslog" do
45   action [:enable, :start]
46   supports :status => true, :restart => true, :reload => true
47 end
48
49 # Remove some unused and unwanted packages
50 package %w[mlocate whoopsie] do
51   action :purge
52 end
53
54 # Configure cron to run in the local timezone of the machine
55 systemd_service "cron-timezone" do
56   service "cron"
57   dropin "timezone"
58   environment "TZ" => node[:timezone]
59   notifies :restart, "service[cron]"
60   only_if { node[:timezone] }
61 end
62
63 # Configure cron with lower cpu and IO priority
64 if node[:tools][:cron][:load]
65   systemd_service "cron-load" do
66     service "cron"
67     dropin "load"
68     nice node[:tools][:cron][:load][:nice]
69     io_scheduling_class node[:tools][:cron][:load][:io_scheduling_class]
70     io_scheduling_priority node[:tools][:cron][:load][:io_scheduling_priority]
71     notifies :restart, "service[cron]"
72   end
73 end
74
75 # Make sure cron is running
76 service "cron" do
77   action [:enable, :start]
78 end
79
80 # Ubuntu MOTD adverts be-gone
81 template "/etc/default/motd-news" do
82   source "motd-news.erb"
83   owner "root"
84   group "root"
85   mode "644"
86 end