[chef] is @node the new node?


Chronological Thread 
  • From: Guy Matz < >
  • To:
  • Subject: [chef] is @node the new node?
  • Date: Tue, 11 Mar 2014 09:56:38 -0400

Hi!

I have a template that contains a reference to node (node['fqdn'], to be exact).  It works on chef 10 and 11.6, but chokes on chef 11.8 with:

================================================================================
Error executing action `install` on resource 'sudo[converter]'
================================================================================


NameError
---------
undefined local variable or method `node' for #<Erubis::Context:0x000000051f66e8>

This doesn't specify the template or the issue.  Any-hoo, I was able to track it down, *I think* to the template above which contains:
# This file is managed by Chef for <%= node['fqdn'] %>
# Do NOT modify this file directly.

<% @commands.each do |command| -%>
<%= @sudoer %>  <%= @host %>=(<%= @runas %>) <%= 'NOPASSWD:' if @nopasswd %><%= command %>
<% end -%>

It works when I change that first line to:
# This file is managed by Chef for <%= @node['fqdn'] %>

Did something change in chef?  I'm looked around the tubes for beaking changes and don't see this as one . . .  anyone have any advice!?


Thanks a lot,
Guy



Archive powered by MHonArc 2.6.16.

§