[COOK-668] - rearrange postfix service
* Supported platforms (Debian and RHEL families) have status, reload and restart commands in their init scripts, we can specify those as supported by the service. * the service should be enabled at boot time on all platforms * Make sure that the service gets started at the end of the recipe since it wouldn't be started, only restarted, elsewhere.
This commit is contained in:
parent
002bcb8029
commit
251f37a272
@ -22,15 +22,13 @@ package "postfix" do
|
|||||||
action :install
|
action :install
|
||||||
end
|
end
|
||||||
|
|
||||||
case node[:platform]
|
|
||||||
when "ubuntu", "debian"
|
|
||||||
service "postfix" do
|
service "postfix" do
|
||||||
|
supports :status => true, :restart => true, :reload => true
|
||||||
action :enable
|
action :enable
|
||||||
end
|
end
|
||||||
when "redhat", "centos"
|
|
||||||
service "postfix" do
|
case node[:platform]
|
||||||
action :nothing
|
when "redhat", "centos", "amazon", "scientific"
|
||||||
end
|
|
||||||
service "sendmail" do
|
service "sendmail" do
|
||||||
action :nothing
|
action :nothing
|
||||||
end
|
end
|
||||||
@ -51,3 +49,7 @@ end
|
|||||||
notifies :restart, resources(:service => "postfix")
|
notifies :restart, resources(:service => "postfix")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
service "postfix" do
|
||||||
|
action :start
|
||||||
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user