Skip to content

Instantly share code, notes, and snippets.

@akinnard
Created April 24, 2016 03:55
Show Gist options
  • Save akinnard/4921f08f59d582cce83efab65d6254e2 to your computer and use it in GitHub Desktop.
Save akinnard/4921f08f59d582cce83efab65d6254e2 to your computer and use it in GitHub Desktop.
In a chef template, use the recipe runlist in an if statement.
<% if node['recipes'].include? "recipe-name" %>
attributes=true
<% else %>
attribute=false
<% end %>
@akinnard
Copy link
Author

The same example would work for roles as well. Just change "node['recipes']" to "node['roles']"

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