Skip to content

Instantly share code, notes, and snippets.

@jamesonjlee
Created August 1, 2013 20:42
Show Gist options
  • Save jamesonjlee/6135093 to your computer and use it in GitHub Desktop.
Save jamesonjlee/6135093 to your computer and use it in GitHub Desktop.
cleanest way of excluding sub-array in chef node attributes
default['mongodb']['sysconfig']['ulimit']['file_limit'] = 12345
default['mongodb']['sysconfig']['ENABLE_MONGODB'] = "yes"
default['mongodb']['sysconfig']['port'] = 27107
#
# Automatically generated by chef, do not edit directly!
#
<% node['mongodb']['sysconfig'].to_hash.keys.sort.each do |key| %>
<% if node['mongodb']['sysconfig'][key].kind_of? String or node['mongodb']['sysconfig'][key].kind_of? Integer %>
<%= key %> = <%= node['mongodb']['sysconfig'][key] %>
<% end %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment