hiya. i have a lot of WET code when it comes to controlling cron on CentOS vs
Ubuntu. anyone have suggestions on abstracting this, making it DRY?
on CentOS, the service is known as “crond”, Ubuntu, “cron”. bummer.
thots? thanks!
kallen
template “/etc/cron.d/blah-maint” do
source "blah-maint-cron.erb"
mode 0644
if platform?(“redhat”, “centos”)
notifies :reload, “service[crond]”, :delayed
elsif platform?(“debian”, “ubuntu”)
notifies :reload, “service[cron]”, :delayed
end
end
if platform?(“redhat”, “centos”)
service “crond” do
supports [ :reload, :status ]
action [ :reload ]
end
end
if platform?(“debian”, “ubuntu”)
service “cron” do
supports [ :reload, :status ]
action [ :reload ]
end
end