# Copyright (C) 2011-2012 RightScale, Inc, All Rights Reserved Worldwide. # # THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE # AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use, # reproduction, modification, or disclosure of this program is # strictly prohibited. Any use of this program by an authorized # licensee is strictly subject to the terms and conditions, # including confidentiality obligations, set forth in the applicable # License Agreement between RightScale.com, Inc. and # the licensee module RightConf class PackagesConfigurator include Configurator register :packages description 'Installs packages defined for running platform' settings :debian => 'Packages to be installed on Debian based Linux', :centos => 'Packages to be installed on RedHat / Centos', :windows => 'Softwared to be downloaded and installed on Windows', :darwin => 'Brew packages to be installed on Mac OS X (https://github.com/mxcl/homebrew)', :abort_on_failure => 'Whether to abort if packages failed to install (false by default)' # Let package manager check for idempotency, return false # # === Return # false:: Always return false def check_linux false end alias :check_darwin :check_linux alias :check_windows :check_linux # Install packages on debian based oses # # === Return # true:: Always return true def run_linux_ubuntu PackageInstaller.install(debian, options) true end alias :run_linux_debian :run_linux_ubuntu # Install packages on centos based oses # # === Return # true:: Always return true def run_linux_centos PackageInstaller.install(centos, options) true end alias :run_linux_redhat :run_linux_centos # Install packages on macs # # === Return # true:: Always return true def run_darwin PackageInstaller.install(darwin, options) true end protected # Calculate options to be given to installer # # === Return # opts(Hash):: Hash of options to be given to installer def options opts = { :report => true } opts.merge!({ :abort_on_failure => 'Failed to install packages' }) if abort_on_failure opts end end end