Skip to content

Instantly share code, notes, and snippets.

@nmilford
Created April 15, 2011 19:56
Show Gist options
  • Save nmilford/922362 to your computer and use it in GitHub Desktop.
Save nmilford/922362 to your computer and use it in GitHub Desktop.
Trying to build a chef template that enumerates directories from an array
directories:
<% @node[:app][:directories].each do |d| %>
- <% d %>
<% end %>
Whereas node[:app][:directories] is an array that currently has six entries...
default[:app][:directories] = [ "/data/a/", "/data/b/", "/data/c/", "/data/d/", "/data/e/", "/data/f/" ]
Compiled, the template ends up like this:
directories:
-
-
-
-
-
-
What am I doing wrong?
@DeathMetalCoder
Copy link

directories:
<% @node[:app][:directories].each do |d| %>
    - <%= d %>
<% end %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment