templates/base/config/rubber/deploy-setup.rb in rubber-2.11.0 vs templates/base/config/rubber/deploy-setup.rb in rubber-2.12.0
- old
+ new
@@ -102,7 +102,13 @@
after "rubber:bootstrap", "rubber:base:reinstall_virtualbox_additions"
task :reinstall_virtualbox_additions, :only => { :provider => 'vagrant' } do
rsudo "service vboxadd setup"
end
+
+ task :cleanup_old_kernels do
+ rubber.sudo_script 'cleanup_old_kernels', <<-ENDSCRIPT
+ dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\\(.*\\)-\\([^0-9]\\+\\)/\\1/")"'/d;s/^[^ ]* [^ ]* \\([^ ]*\\).*/\\1/;/[0-9]/!d' | xargs dpkg --purge
+ ENDSCRIPT
+ end
end
end