ruby - Chef Template Does Not Evaluate chef_environment and name Correctly -
knife node show -l my-node -f json returns:
{ "name": "my-node", "chef_environment": "test" .. } we have created template, info.txt.erb:
node = <%= node %> name = <%= node['name'] %> chef_environment = <%= node['chef_environment'] %> our recipe:
template "#{app_dir}/info.txt" source 'info.txt.erb' ... end after chef run, node has info.txt file:
node = my-node name = chef_environment = why knife show <node> command return different evaluated template file? how can change template file correct information?
that should node.name , node.chef_environment. aren't attributes, can't use attribute access syntax them.
Comments
Post a Comment