chef / cookstyle

A linting tool that helps you to write better Chef Infra cookbooks and InSpec profiles by detecting and automatically correcting style, syntax, and logic mistakes in your code.
Apache License 2.0
109 stars 54 forks source link

Detect using template or file to create a cron.d config #526

Closed tas50 closed 4 years ago

tas50 commented 4 years ago

What category of cop is this?:

Please try to select as few as possible.

Describe the new cop:

We should encourage the usage of the cron_d resource instead of file/template to create cron jobs.

What it would trigger on:

file '/etc/cron.d/novnc_tokens' do
  content "* * * * * root /opt/websockify/novnc_tokens.rb -a #{node['abiquo']['websockify']['api_url']} -u #{node['abiquo']['websockify']['user']} -p #{node['abiquo']['websockify']['pass']} -f /opt/websockify/config.vnc"
  owner 'root'
  group 'root'
  mode  '0644'
  action :create
  notifies :restart, 'service[websockify]'
end
tas50 commented 4 years ago

Shipped in 6.13