You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use a cookbook_file resource to process a file in /etc/cron.daily
Steps to Reproduce:
Add the following resource to a cookbook recipe:
cookbook_file '/etc/cron.daily/locate' do
source 'locate'
owner 'root'
group 'root'
mode '755'
end
Then run cookstyle
Expected Result:
I expect no warning from this.
Actual Result:
Chef/Modernize/CronDFileOrTemplate: Use the cron_d resource that ships with Chef Infra Client 14.4+ instead of manually creating the file with template, file, or cookbook_file resources (https://docs.chef.io/workstation/cookstyle/chef_modernize_crondfileortemplate) cookbook_file '/etc/cron.daily/locate' do ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I am guessing that the cop is triggering on cron.d*, instead of just cron.d
FYI: cron.daily is a directory where scripts can be dropped that run daily, cron.d is a directory where cron jobs with full cron configuration (i.e.: with time, user, etc) are placed.
The text was updated successfully, but these errors were encountered:
Version:
Chef Workstation 22.2.807
Cookstyle 7.32.0
Environment:
Debian 11
Scenario:
We use a cookbook_file resource to process a file in /etc/cron.daily
Steps to Reproduce:
Add the following resource to a cookbook recipe:
Then run cookstyle
Expected Result:
I expect no warning from this.
Actual Result:
Chef/Modernize/CronDFileOrTemplate: Use the cron_d resource that ships with Chef Infra Client 14.4+ instead of manually creating the file with template, file, or cookbook_file resources (https://docs.chef.io/workstation/cookstyle/chef_modernize_crondfileortemplate) cookbook_file '/etc/cron.daily/locate' do ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I am guessing that the cop is triggering on cron.d*, instead of just cron.d
#946 seems to have a very similar issue
FYI: cron.daily is a directory where scripts can be dropped that run daily, cron.d is a directory where cron jobs with full cron configuration (i.e.: with time, user, etc) are placed.
The text was updated successfully, but these errors were encountered: