【发布时间】:2015-03-13 03:38:08
【问题描述】:
我自己编写了运行良好的提供程序,例如:
my_custom_provider "#{node['ipaddress']}" do
my_attribute_1 node['ipaddress']
action :create
end
template '/opt/app/something.conf' do
mode '0664'
owner 'someuser'
group 'someuser'
notyfies :restart, "my_custom_provider[#{node['ipaddress']}]", :delayed
end
我收到错误(在Vagrant 中的chef-solo 下):
ERROR: resource template[/opt/app/something.conf] is configured to notify
resource my_custom_provider[10.0.2.15] with action restart, but
my_custom_provider[10.0.2.15] cannot be found in the resource collection.
template[/opt/app/something.conf] is defined in
/tmp/vagrant-chef/2a59b2477390af49acec413909d80cf5/cookbooks/project/recipes/default.rb:76:in `from_file'
但是当我反转通知方向时它工作正常:
my_custom_provider "#{node['ipaddress']}" do
my_attribute_1 node['ipaddress']
action :create
subscribes :restart, 'template[/opt/app/something.conf]', :delayed
end
template '/opt/app/something.conf' do
mode '0664'
owner 'someuser'
group 'someuser'
end
我认为这是在vagrant 下运行的chef-solo 中的一个错误,或者我无法将自定义提供程序添加为通知目标?
【问题讨论】:
-
之前没有警告吗?你能分享你的 LWRP 或 HWRP 代码吗?
标签: vagrant chef-infra chef-solo