【发布时间】:2015-06-25 10:32:55
【问题描述】:
我正在尝试更改一个资源中的属性并希望在另一个资源中使用更新的值,但更新的值没有反映在另一个资源中。请帮帮我
代码
node[:oracle][:asm][:disks].each_key do |disk|
Chef::Log.info("I am in #{cookbook_name}::#{recipe_name} and current disk count #{node[:oracle][:asm][:test]}")
bash "beforeTest" do
code <<-EOH
echo #{node[:oracle][:asm][:test]}
EOH
end
ruby_block "test current disk count" do
block do
node.set[:oracle][:asm][:test] = "#{node[:oracle][:asm][:test]}".to_i+1
end
end
bash "test" do
code <<-EOH
echo #{node[:oracle][:asm][:test]}
EOH
end
end
我要更新的值是存储在node[:oracle][:asm][:test]的值
【问题讨论】:
标签: ruby chef-infra recipe