Skip to content

Commit

Permalink
Added 'lamp stack removed', for use in specific configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
benhoskings committed Jan 20, 2011
1 parent 7e5dd2c commit 09aca17
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions apache.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
dep 'lamp stack removed', :for => :apt do
def packages
shell("dpkg --get-selections").select {|l|
l[/\binstall$/]
}.split("\n").map {|l|
l.split(/\s+/, 2).first
}.select {|l|
l[/apache|mysql|php/]
}
end
met? {
packages.empty?
}
meet {
packages.each {|pkg|
log_shell "Removing #{pkg}", "apt-get -y remove --purge '#{pkg}'", :sudo => true
}
}
after {
log_shell "Autoremoving packages", "apt-get -y autoremove", :sudo => true
}
end

0 comments on commit 09aca17

Please sign in to comment.