Chef infra 如何取消厨师食谱中的订阅或通知?

Chef infra 如何取消厨师食谱中的订阅或通知?,chef-infra,cookbook,subscribe,recipe,Chef Infra,Cookbook,Subscribe,Recipe,我在这里遇到一个问题: 例如,厨师食谱是openstack network::openvswitch service 'neutron-plugin-openvswitch-agent' do service_name platform_options['neutron_openvswitch_agent_service'] supports status: true, restart: true action :enable subscribes :restart, 'temp

我在这里遇到一个问题: 例如,厨师食谱是openstack network::openvswitch

service 'neutron-plugin-openvswitch-agent' do
  service_name platform_options['neutron_openvswitch_agent_service']
  supports status: true, restart: true
  action :enable
  subscribes :restart, 'template[/etc/neutron/neutron.conf]'
end
我想在这里做的是取消“中子插件openvswitch代理”服务的订阅。我查看了Chef::Resource文档,但找不到这种API。 在ruby_块中,我可以使用

resources('service[neutron-plugin-openvswitch-agent').action(:nothing)

要在对资源应用操作之前更改资源的操作,有没有办法取消资源的订阅甚至通知

最简单的选择是使用chef rewind的
unwind
helper。一般来说,这不是一件容易的事情,通知不存在于资源对象中,它们是运行上下文数据的一部分。

最简单的选择是使用chef rewind的
unwind
帮助程序。一般来说,这不是一件容易的事情,通知不存在于资源对象中,它们是运行上下文数据的一部分