Skip to content

Instantly share code, notes, and snippets.

@Maniacal
Created October 1, 2014 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Maniacal/fcb5fa508ce712525494 to your computer and use it in GitHub Desktop.
Save Maniacal/fcb5fa508ce712525494 to your computer and use it in GitHub Desktop.
In the error below, ldap_servers is an array passed to the template. Array is being defined in the cookbook attributes
Chef::Mixin::Template::TemplateError (Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"') on line #14:
12: # Multiple entries may be specified. The address that is used
13: # here should be resolvable without using LDAP (obviously).
14: uri <% nodes = @ldap_servers.collect! { |a| "ldaps://" + a } -%><%= nodes.join(" ") %>
15: base <%= @ldap_base %>
16: tls_cacertdir <%= @certdir %>
========================================
The code below this is not getting an error. memcached_nodes is also an array but it comes from a data_bag.
<% nodes = @memcached_nodes.collect! { |a| "array('" + a + "',11211)" } -%><%= nodes.join(",") %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment