lib/beaker-pe/install/pe_utils.rb in beaker-pe-0.1.2 vs lib/beaker-pe/install/pe_utils.rb in beaker-pe-0.2.0

- old
+ new

@@ -408,11 +408,16 @@ msi_path = "#{host['working_dir']}\\#{host['dist']}.msi" install_msi_on(host, msi_path, {}, opts) # 1 since no certificate found and waitforcert disabled acceptable_exit_codes = 1 - setup_defaults_and_config_helper_on(host, master, acceptable_exit_codes) + if masterless + configure_type_defaults_on(host) + on host, puppet_agent('-t'), :acceptable_exit_codes => acceptable_exit_codes + else + setup_defaults_and_config_helper_on(host, master, acceptable_exit_codes) + end else # We only need answers if we're using the classic installer version = host['pe_ver'] || opts[:pe_ver] if host['roles'].include?('frictionless') && (! version_is_less(version, '3.2.0')) # If We're *not* running the classic installer, we want @@ -632,23 +637,36 @@ if (dashboard[:pe_ver] ? version_is_less(dashboard[:pe_ver], "3.4.0") : true) set_console_password = true end # get new version information 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 + prep_host_for_upgrade(host, opts, path) end do_install(sorted_hosts, opts.merge({:type => :upgrade, :set_console_password => set_console_password})) opts['upgrade'] = true + end + end + + #Prep a host object for upgrade; used inside upgrade_pe_on + # @param [Host] host A single host object to prepare for upgrade + # !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 + # prep_host_for_upgrade(master, {}, "http://neptune.puppetlabs.lan/3.0/ci-ready/") + def prep_host_for_upgrade(host, opts={}, path='') + 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 #Create the Higgs install command string based upon the host and options settings. Installation command will be run as a #background process. The output of the command will be stored in the provided host['higgs_file'].