Created
April 15, 2011 19:56
-
-
Save nmilford/922362 to your computer and use it in GitHub Desktop.
Trying to build a chef template that enumerates directories from an array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
commented
Jun 24, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment