You're missing the `node[:bind][role]` etc. the node object allows you to access attributes there.In general I'd recommend using the variables() parameter to the template resource to bind particular attributes to known variables in advance, then refer to those instance variables in the template, kind of as a known interface between the node, the recipe and the template itself. Means you can change the templates variables from one attribute to another, more readily.cheers,--ajOn Fri, Jun 12, 2015 at 11:01 AM Jennifer Fountain < " target="_blank"> > wrote:Here is what I am trying to do:<% %w[zone1 zone1].each do |role| -%>zone "<%= role %>.domain.com" in {type master;file "<%= role %>.domain.conf";<% if [:bind][role][:notify] != nil %>notify yes;also-notify { [<%= [:bind][role][:notify_ip] %>; };<% end %>allow-update { <%= [:bind][role][:allow_update_ip] %>; };};<% end %>This works as expected:<% %w[zone1 zone1].each do |role| -%>zone "<%= role %>.domain.com" in {type master;file "<%= role %>.domain.conf";};<% end %>This not so much:<% if [:bind][role][:notify] != nil %>notify yes;also-notify { [<%= [:bind][role][:notify_ip] %>; };<% end %>allow-update { <%= [:bind][role][:allow_update_ip] %>; };};I have tried several different variations but chef_zero is still throwing errors.eg: Chef::Mixin::Template::TemplateError (no implicit conversion of String into Integer) on line #68:Is this not possible? Thanks for any advice!--Jennifer FountainDevOPS
Archive powered by MHonArc 2.6.16.