- From:
- To: chef <
>
- Subject: [chef] coding style, abstracting "cron" vs "crond"
- Date: Tue, 18 Sep 2012 12:15:36 -0700
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
- [chef] coding style, abstracting "cron" vs "crond", kallen, 09/18/2012
Archive powered by MHonArc 2.6.16.