# Copyright (C) 2011 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', :mac => '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)' # Install debian packages # # === Return # true:: Always return true def run_linux_ubuntu return if debian.nil? report_check("Installing the following packages:\n#{debian.join(' ')}\nThis could take a while") opts = debian.dup opts << { :abort_on_failure => 'Failed to install packages' } if abort_on_failure Command.execute('sudo', 'apt-get', 'install', '-y', *opts) report_success end alias :run_linux_debian :run_linux_ubuntu # Install yum packages # # === Return # true:: Always return true def run_linux_centos return if centos.nil? report_check("Installing the following packages:\n#{centos.join(' ')}\nThis could take a while") opts = centos.dup opts << { :abort_on_failure => 'Failed to install packages' } if abort_on_failure Command.execute('sudo', 'yum', 'install', '-y', *opts) report_success end alias :run_linux_redhat :run_linux_centos # Install Windows software # # === Return # true:: Always return true def run_windows # TBD end # Use brew on Mac OS X # # === Return # true:: Always return true def run_darwin # TBD, check brew is installed then use end end end