From 6cce603b75b8ea9dc9a234f49427583abc9c0a1a Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 21 Jul 2020 20:37:24 +0100 Subject: [PATCH] Enable ChefModernize/CronDFileOrTemplate cop --- .rubocop_todo.yml | 4 ---- cookbooks/mediawiki/resources/site.rb | 4 ---- cookbooks/nominatim/recipes/default.rb | 4 ---- cookbooks/tile/recipes/default.rb | 4 ---- cookbooks/tilecache/recipes/default.rb | 2 +- 5 files changed, 1 insertion(+), 17 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 93def5b39..6be451ec0 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -27,10 +27,6 @@ ChefCorrectness/NodeNormalUnless: - 'cookbooks/mediawiki/resources/site.rb' - 'cookbooks/wordpress/resources/site.rb' -# Offense count: 23 -ChefModernize/CronDFileOrTemplate: - Enabled: false - # Offense count: 1 # Configuration parameters: Include. # Include: **/definitions/*.rb diff --git a/cookbooks/mediawiki/resources/site.rb b/cookbooks/mediawiki/resources/site.rb index 0ff2dcc74..3146ab37f 100644 --- a/cookbooks/mediawiki/resources/site.rb +++ b/cookbooks/mediawiki/resources/site.rb @@ -175,10 +175,6 @@ action :create do notifies :run, "execute[#{mediawiki_directory}/maintenance/update.php]" end - file "/etc/cron.d/mediawiki-#{cron_name}" do - action :delete - end - cron_d "mediawiki-#{cron_name}-sitemap" do comment "Generate sitemap.xml daily" minute "30" diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index 78bede8ce..d92975742 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -262,10 +262,6 @@ remote_file "#{source_directory}/data/country_osm_grid.sql.gz" do mode 0o644 end -file "/etc/cron.d/nominatim" do - action :delete -end - if node[:nominatim][:state] == "off" cron_d "nominatim-backup" do action :delete diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index c5dc7c87f..e9a569bd1 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -578,10 +578,6 @@ tile_directories = node[:tile][:styles].collect do |_, style| style[:tile_directories].collect { |directory| directory[:name] } end.flatten.sort.uniq -file "/etc/cron.d/cleanup-tiles" do - action :delete -end - tile_directories.each do |directory| label = directory.gsub("/", "-") diff --git a/cookbooks/tilecache/recipes/default.rb b/cookbooks/tilecache/recipes/default.rb index 9ec7b2aeb..adc222685 100644 --- a/cookbooks/tilecache/recipes/default.rb +++ b/cookbooks/tilecache/recipes/default.rb @@ -123,7 +123,7 @@ template "/usr/local/bin/nginx_generate_tilecache_qos_map" do variables :totp_key => web_passwords["totp_key"] end -file "/etc/cron.d/tilecache" do +cron_d "tilecache" do action :delete end -- 2.39.5