Sha256: d6bdf33ac61d1a4fee53aefbed25520ad6102476e586834a5f8b485d31de0866

Contents?: true

Size: 921 Bytes

Versions: 2

Compression:

Stored size: 921 Bytes

Contents

namespace :packages do
  
  desc <<-DESC
  Remove, update and install packages.
  
  packages_type: Package manager type. Currently can only be :yum. \n\nTODO: Support more package managers.
  
    set :packages_type, :yum
    
  packages_remove: Packages to remove.  
    
    set :packages_remove, [ "openoffice.org-*", "ImageMagick" ]
    
  packages_add: Packages to add.    
  
    set :packages_add, [ "gcc", "kernel-devel", "libevent-devel", "libxml2-devel" ]
    
  DESC
  task :install do
    
    # Settings
    fetch(:packages_type)
    fetch(:packages_add)
    fetch(:packages_remove)
    
    # Set package type
    package.type = packages_type
    
    # Remove packages          
    package.remove(packages_remove) unless packages_remove.blank?
    
    # Update all existing packages
    package.update
    
    # Install packages
    package.install(packages_add) unless packages_add.blank?
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capitate-0.1.8 lib/recipes/packages.rb
capitate-0.1.9 lib/recipes/packages.rb