是否可以通过通知 属性 指定多个操作?
Is it possible to specify multiple actions with notification property?
是否可以使用通知资源指定多个操作 属性?
template '/etc/some.conf' do
source 'etc/some.conf.erb'
mode 0640
owner 'root'
group 'root'
notifies [ :restart, :enable ], "service[restart some service]", :delayed
end
service "restart some service" do
service_name some
action :nothing
end
这会引发以下错误:
NoMethodError
-------------
undefined method `to_sym' for [:restart, :enabled]:Array
这是指定多个动作的唯一方法吗>
notifies :enable, "service[restart some service]", :delayed
notifies :restart, "service[restart some service]", :delayed
如您所示,您将使用两个通知。
是否可以使用通知资源指定多个操作 属性?
template '/etc/some.conf' do
source 'etc/some.conf.erb'
mode 0640
owner 'root'
group 'root'
notifies [ :restart, :enable ], "service[restart some service]", :delayed
end
service "restart some service" do
service_name some
action :nothing
end
这会引发以下错误:
NoMethodError
-------------
undefined method `to_sym' for [:restart, :enabled]:Array
这是指定多个动作的唯一方法吗>
notifies :enable, "service[restart some service]", :delayed
notifies :restart, "service[restart some service]", :delayed
如您所示,您将使用两个通知。