From 9f39ec6f956dd455e5f15f2be0e7f19b1cdf50bf Mon Sep 17 00:00:00 2001 From: "Michael S. Klishin" Date: Thu, 15 Mar 2012 16:28:39 +0400 Subject: [PATCH] Clean up apt packages at the end of Chef run --- ci_environment/apt/recipes/default.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ci_environment/apt/recipes/default.rb b/ci_environment/apt/recipes/default.rb index 1bd7329ca..f589609da 100644 --- a/ci_environment/apt/recipes/default.rb +++ b/ci_environment/apt/recipes/default.rb @@ -20,10 +20,16 @@ execute "apt-get update" do action :run end +execute "apt-get -y autoclean autoremove" do + action :nothing +end template "/etc/apt/sources.list" do source "sources.list.erb" notifies :run, resources(:execute => "apt-get update"), :immediately + + # cleans up at the end of Chef run + notifies :run, resources(:execute => "apt-get -y autoclean autoremove") end %w{/var/cache/local /var/cache/local/preseeding}.each do |dirname|