5 # Copyright:: 2011, OpenStreetMap Foundation
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
11 # https://www.apache.org/licenses/LICENSE-2.0
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.
45 action [:enable, :start]
46 supports :status => true, :restart => true, :reload => true
49 # Remove some unused and unwanted packages
50 package %w[mlocate whoopsie] do
54 # Configure cron to run in the local timezone of the machine
55 systemd_service "cron-timezone" do
58 environment "TZ" => node[:timezone]
59 notifies :restart, "service[cron]"
60 only_if { node[:timezone] }
63 # Configure cron with lower cpu and IO priority
64 if node[:tools][:cron][:load]
65 systemd_service "cron-load" do
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]"
75 # Make sure cron is running
77 action [:enable, :start]
80 # Ubuntu MOTD adverts be-gone
81 template "/etc/default/motd-news" do
82 source "motd-news.erb"