I working on chef which i needs to call attribute value from attributes/default.rb
file to recipe/default.rb
file.
I am invoked attribute values in recipe which throws an error
undefined method [] for nil:NilClass`
Can someone help me on this.
# attribute/default.rb
default['app']['dir'] = "/opt/app/"
# recipe/default.rb
ruby_block 'print_name' do
block do
puts "My app dir #{ node['app']['dir'] } "
end
end
node['app']
isnil
instead of a Hash. – StephenKingattribute/
as you write, orattributes/
, as it is expected? Mind the trailings
! – StephenKingattributes/
andrecipes/
. – coderanger