lib/beaker/dsl/install_utils/pe_utils.rb
#Upgrade PE based upon host configuration and options
# @param [Host, Array<Host>]  upgrade_hosts   One or more hosts to act upon
# @!macro common_opts
# @param [String] path A path (either local directory or a URL to a listing of PE builds).
#                      Will contain a LATEST file indicating the latest build to install.
#                      This is ignored if a pe_upgrade_ver and pe_upgrade_dir are specified
#                      in the host configuration file.
# @example
#  upgrade_pe_on(agents, {}, "http://neptune.puppetlabs.lan/3.0/ci-ready/")
#
# @note Install file names are assumed to be of the format puppet-enterprise-VERSION-PLATFORM.(tar)|(tar.gz)
#       for Unix like systems and puppet-enterprise-VERSION.msi for Windows systems.
Upgrade PE based upon host configuration and options
Upgrade PE based upon host configuration and options
def upgrade_pe_on upgrade_hosts, opts, path=nil
          confine_block(:to, {}, upgrade_hosts) do
            set_console_password = false
            if (dashboard[:pe_ver] ? version_is_less(dashboard[:pe_ver], "3.4.0") : true)
              set_console_password = true
            end
            hosts.each do |host|
              host['pe_dir'] = host['pe_upgrade_dir'] || path
              if host['platform'] =~ /windows/
                host['pe_ver'] = host['pe_upgrade_ver'] || opts['pe_upgrade_ver'] ||
                  Options::PEVersionScraper.load_pe_version(host['pe_dir'], opts[:pe_version_file_win])
              else
                host['pe_ver'] = host['pe_upgrade_ver'] || opts['pe_upgrade_ver'] ||
                  Options::PEVersionScraper.load_pe_version(host['pe_dir'], opts[:pe_version_file])
              end
              if version_is_less(host['pe_ver'], '3.0')
                host['pe_installer'] ||= 'puppet-enterprise-upgrader'
              end
            end
            do_install(sorted_hosts, opts.merge({:type => :upgrade, :set_console_password => set_console_password}))
            opts['upgrade'] = true
          end
        end
def upgrade_pe_on upgrade_hosts , opts , path = nil confine_block ( :to , { } , upgrade_hosts ) do set_console_password = false if ( dashboard [ :pe_ver ] ? version_is_less ( dashboard [ :pe_ver ] , "3.4.0" ) : true ) set_console_password = true end hosts . each do | host | host [ 'pe_dir' ] = host [ 'pe_upgrade_dir' ] || path if host [ 'platform' ] =~ / windows / host [ 'pe_ver' ] = host [ 'pe_upgrade_ver' ] || opts [ 'pe_upgrade_ver' ] || Options :: PEVersionScraper . load_pe_version ( host [ 'pe_dir' ] , opts [ :pe_version_file_win ] ) else host [ 'pe_ver' ] = host [ 'pe_upgrade_ver' ] || opts [ 'pe_upgrade_ver' ] || Options :: PEVersionScraper . load_pe_version ( host [ 'pe_dir' ] , opts [ :pe_version_file ] ) end if version_is_less ( host [ 'pe_ver' ] , '3.0' ) host [ 'pe_installer' ] ||= 'puppet-enterprise-upgrader' end end do_install ( sorted_hosts , opts . merge ( { :type => :upgrade , :set_console_password => set_console_password } ) ) opts [ 'upgrade' ] = true end end
Upgrade PE based upon host configuration and options
Upgrade PE based upon host configuration and options
# if we are upgrading from something lower than 3.4 then we need to set the pe console password # get new version information
upgrade_hosts
<not_specific>
opts
<not_specific>
path
<not_specific>
<not_specific>
path A path (either local directory or a URL to a listing of PE builds). Will contain a LATEST file indicating the latest build to install. This is ignored if a pe_upgrade_ver and pe_upgrade_dir are specified in the host configuration file.
path A path ( either local directory or a URL to a listing of PE builds ) . Will contain a LATEST file indicating the latest build to install . This is ignored if a pe_upgrade_ver and pe_upgrade_dir are specified in the host configuration file .
!macro
None
example
None
note
Install file names are assumed to be of the format puppet-enterprise-VERSION-PLATFORM.(tar)|(tar.gz) for Unix like systems and puppet-enterprise-VERSION.msi for Windows systems.
Install file names are assumed to be of the format puppet - enterprise - VERSION - PLATFORM . ( tar ) | ( tar . gz ) for Unix like systems and puppet - enterprise - VERSION . msi for Windows systems .