Skip to content

Instantly share code, notes, and snippets.

@e100
e100 / Chef code to clean up resources that are no longer needed
Created March 6, 2014 16:34
Chef code example shoing how to keep track of consumed attributes, then clean up when previously consumed attributes are no longer defined.
include_recipe 'apache2'
#loops through some attributes and creates a web_app for each one
node.something.sites.each do |name,data|
web_app name do
template "apache2/template.erb"
owner data['user']
group data['group']
end