lib/beaker-pe/install/pe_utils.rb in beaker-pe-1.7.0 vs lib/beaker-pe/install/pe_utils.rb in beaker-pe-1.8.0

- old
+ new

@@ -395,14 +395,12 @@ # If we're installing a database version less than 3.0, ignore the database host install_hosts.delete(database) if pre30database and database != master and database != dashboard end install_hosts.each do |host| - #windows agents from 4.0 -> 2016.1.2 were only installable via the aio method - is_windows_msi_and_aio = (host['platform'] =~ /windows/ && (version_is_less(host['pe_ver'], '2016.3.0') && !version_is_less(host['pe_ver'], '3.99'))) - if agent_only_check_needed && hosts_agent_only.include?(host) || is_windows_msi_and_aio + if agent_only_check_needed && hosts_agent_only.include?(host) || install_via_msi?(host) host['type'] = 'aio' install_puppet_agent_pe_promoted_repo_on(host, { :puppet_agent_version => get_puppet_agent_version(host, opts), :puppet_agent_sha => host[:puppet_agent_sha] || opts[:puppet_agent_sha], :pe_ver => host[:pe_ver] || opts[:pe_ver], @@ -411,11 +409,11 @@ # 1 since no certificate found and waitforcert disabled acceptable_exit_codes = [0, 1] acceptable_exit_codes << 2 if opts[:type] == :upgrade setup_defaults_and_config_helper_on(host, master, acceptable_exit_codes) #Windows allows frictionless installs starting with PE Davis, if frictionless we need to skip this step - elsif (host['platform'] =~ /windows/ && !(host['roles'].include?('frictionless'))) + elsif (host['platform'] =~ /windows/ && !(host['roles'].include?('frictionless')) || install_via_msi?(host)) opts = { :debug => host[:pe_debug] || opts[:pe_debug] } msi_path = "#{host['working_dir']}\\#{host['dist']}.msi" install_msi_on(host, msi_path, {}, opts) # 1 since no certificate found and waitforcert disabled @@ -611,9 +609,18 @@ end # True if version is greater than or equal to MEEP_CUTOVER_VERSION (2016.2.0) def use_meep?(version) !version_is_less(version, MEEP_CUTOVER_VERSION) + end + + # Check if windows host is able to frictionlessly install puppet + # @param [Beaker::Host] host that we are checking if it is possible to install frictionlessly to + # @return [Boolean] true if frictionless is supported and not affected by known bugs + def install_via_msi?(host) + #windows agents from 4.0 -> 2016.1.2 were only installable via the aio method + #powershell2 bug was fixed in PE 2016.4.3 + (host['platform'] =~ /windows/ && (version_is_less(host['pe_ver'], '2016.4.0') && !version_is_less(host['pe_ver'], '3.99'))) || (host['platform'] =~ /windows-2008r2/ && (version_is_less(host['pe_ver'], '2016.4.3') && !version_is_less(host['pe_ver'], '3.99'))) end # On July 8th, 2016, the gpg key that was shipped and used to sign repos in # PE tarballs expired. This affects all PE version earlier then 3.8.5, and # versions between 2015.2 to 2016.1.2.