lib/beaker-pe/install/pe_utils.rb in beaker-pe-0.6.0 vs lib/beaker-pe/install/pe_utils.rb in beaker-pe-0.7.0

- old
+ new

@@ -107,10 +107,22 @@ "cd #{host['working_dir']} && hdiutil attach #{host['dist']}.dmg && installer#{pe_debug} -pkg /Volumes/puppet-enterprise-#{version}/puppet-enterprise-installer-#{version}.pkg -target /" elsif host['platform'] =~ /eos/ host.install_from_file("puppet-enterprise-#{version}-#{host['platform']}.swix") else pe_debug = host[:pe_debug] || opts[:pe_debug] ? ' -D' : '' - "cd #{host['working_dir']}/#{host['dist']} && ./#{host['pe_installer']}#{pe_debug} #{host['pe_installer_conf_setting']}" + pe_cmd = "cd #{host['working_dir']}/#{host['dist']} && ./#{host['pe_installer']}#{pe_debug}" + if ! version_is_less(host['pe_ver'], '2016.2.1') + # -y option sets "assume yes" mode where yes or whatever default will be assumed + pe_cmd += " -y" + end + + # If there are no answer overrides, and we are doing an upgrade from 2016.2.0, + # we can assume there will be a valid pe.conf in /etc that we can re-use. + if opts[:answers].nil? && opts[:custom_answers].nil? && opts[:type] == :upgrade && !version_is_less(opts[:HOSTS][host.name][:pe_ver], '2016.2.0') + "#{pe_cmd}" + else + "#{pe_cmd} #{host['pe_installer_conf_setting']}" + end end end #Determine the PE package to download/upload on a mac host, download/upload that package onto the host. # Assumed file name format: puppet-enterprise-3.3.0-rc1-559-g97f0833-osx-10.9-x86_64.dmg.