I am trying to change an attribute in one resource and want to use updated value in another resource but updated value is not getting reflected in another resources. please help
Lazy is good, but here is another approach.
You may use node.run_state
for your purposes.
Here is usage example from https://docs.chef.io/recipes.html
package 'httpd' do
action :install
end
ruby_block 'randomly_choose_language' do
block do
if Random.rand > 0.5
node.run_state['scripting_language'] = 'php'
else
node.run_state['scripting_language'] = 'perl'
end
end
end
package 'scripting_language' do
package_name lazy { node.run_state['scripting_language'] }
action :install
end