我有两个我想按照定义的顺序运行的厨师食谱。首先是安装配方,然后是配置。
这是调用食谱的代码:
ruby_block "bowbridge_config" do
block do
run_context.include_recipe "ids::bowbridge_config"
end
action :nothing
end
ruby_block "bowbridge_install" do
block do
run_context.include_recipe "sap-bowbridge::default"
end
notifies :run, 'ruby_block[bowbridge_config]', :delayed
end
我在配置配方之前成功执行了安装配方,但是当配置配方正在执行时,只打印了打印件。
配置配方代码:
mcaf_lib = find_file "/opt/bowbridge/libAVB*_mcaf.so"
Chef::Log.info("==> bowbridge_config mcaf_lib is #{mcaf_lib}. Vsi file is #{vsi_file}")
bb_cfg = File.basename(find_file "/opt/bowbridge/bbvsa*.cfg")
Chef::Log.info("==> bowbridge_config recipe is triggered")
# Setup bowbridge config file
directory "/etc/bowbridge" do
end
file "/etc/bowbridge/" + bb_cfg do
owner 'root'
group 'root'
mode 0755
content ::File.open("/opt/bowbridge/" + bb_cfg).read
action :create
end
Chef::Log.info("==> bowbridge_config before link creation")
link "/lib64/libvsa.so" do
to "#{mcaf_lib}"
end
上面的代码显示了这个输出:
[2017-02-24T11:25:36+00:00] INFO: ruby_block[bowbridge_install] sending run action to ruby_block[bowbridge_config] (delayed)
[2017-02-24T11:25:36+00:00] INFO: Processing ruby_block[bowbridge_config] action run (ids::default line 82)
[2017-02-24T11:25:37+00:00] INFO: ==> bowbridge_config recipe is triggered
[2017-02-24T11:25:37+00:00] INFO: ==> bowbridge_config before link creation
[2017-02-24T11:25:37+00:00] INFO: ruby_block[bowbridge_config] called
没有创建 /etc/bowbridge 目录,也没有创建 /lib64 内的链接。我可能做错了什么?