Sha256: 6bca3c6e1c528c6812559cb34fcba8935ac3ad66a3f581ba06a7e469c34e404a

Contents?: true

Size: 1.05 KB

Versions: 24

Compression:

Stored size: 1.05 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../utilities')

Capistrano::Configuration.instance(true).load do
  namespace :yum do
    desc "Updates all installed packages on yum package system"
    task :updates do
      utilities.yum_update
    end

    desc "Installs a specified yum package"
    task :install do
      yum_pkg_name = utilities.ask "Enter name of the package(s) you wish to install:"
      raise "Please specify yum_pkg_name" if yum_pkg_name == ''
      logger.info "Updating packages..."
      sudo "yum update"
      logger.info "Installing #{yum_pkg_name}..."
      utilities.yum_install yum_pkg_name
    end

    desc "Removes a specified yum package"
    task :remove do
      yum_pkg_name = utilities.ask "Enter name of the package(s) you wish to remove:"
      raise "Please specify yum_pkg_name" if yum_pkg_name == ''
      logger.info "Updating packages..."
      sudo "yum update"
      logger.info "Removing #{yum_pkg_name}..."
      utilities.sudo_with_input "yum erase -y #{yum_pkg_name}", /^Do you want to continue\?/
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
crazycode-cap-recipes-0.5.3 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.5.2 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.5.1 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.5.0 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.4.14 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.4.13 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.4.12 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.4.11 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.4.10 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.4.9 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.4.8 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.4.6 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.4.5 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.4.4 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.4.3 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.4.2 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.4.1 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.4.0 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.3.39.3 lib/cap_recipes/tasks/yum/manage.rb
crazycode-cap-recipes-0.3.39.2 lib/cap_recipes/tasks/yum/manage.rb