是否可以通过资源属性指定多个操作?
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
答案 0 :(得分:2)
您将在显示时使用两个通知。