]> git.openstreetmap.org Git - chef.git/blob - cookbooks/tools/recipes/default.rb
Use volume for nested podman container storage
[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   conntrack
23   cron
24   curl
25   dmidecode
26   ethtool
27   iotop
28   iptraf-ng
29   locales-all
30   lsof
31   lsscsi
32   lvm2
33   mtr-tiny
34   numactl
35   pciutils
36   ripgrep
37   rsync
38   rsyslog
39   screen
40   smartmontools
41   strace
42   sysstat
43   systemd-coredump
44   tcpdump
45   usbutils
46   vim
47   xfsprogs
48   zstd
49 ]
50
51 if platform?("debian")
52   package "wtmpdb"
53 end
54
55 service "rsyslog" do
56   action [:enable, :start]
57   supports :status => true, :restart => true, :reload => true
58 end
59
60 # Install some common tools
61 remote_directory "/usr/local/bin" do
62   source "local-bin"
63   owner "root"
64   group "root"
65   mode "755"
66   files_owner "root"
67   files_group "root"
68   files_mode "755"
69 end
70
71 # Remove some unused and unwanted packages
72 package %w[mlocate whoopsie] do
73   action :purge
74 end
75
76 # Configure cron to run in the local timezone of the machine
77 systemd_service "cron-timezone" do
78   service "cron"
79   dropin "timezone"
80   environment "TZ" => node[:timezone]
81   notifies :restart, "service[cron]"
82   only_if { node[:timezone] }
83 end
84
85 # Configure cron with lower cpu and IO priority
86 if node[:tools][:cron][:load]
87   systemd_service "cron-load" do
88     service "cron"
89     dropin "load"
90     nice node[:tools][:cron][:load][:nice]
91     io_scheduling_class node[:tools][:cron][:load][:io_scheduling_class]
92     io_scheduling_priority node[:tools][:cron][:load][:io_scheduling_priority]
93     notifies :restart, "service[cron]"
94   end
95 end
96
97 # Make sure cron is running
98 service "cron" do
99   action [:enable, :start]
100 end
101
102 # Ubuntu MOTD adverts be-gone
103 template "/etc/default/motd-news" do
104   source "motd-news.erb"
105   owner "root"
106   group "root"
107   mode "644"
108 end