lib/beaker-pe/install/pe_utils.rb in beaker-pe-2.11.20 vs lib/beaker-pe/install/pe_utils.rb in beaker-pe-2.11.21

- old
+ new

@@ -141,10 +141,15 @@ def require_tlsv1?(host) tlsv1_platforms = [/el-5/, /solaris-1[0,1]-[i,x]/, /sles-11/,/windows-2008/] return tlsv1_platforms.any? {|platform_regex| host['platform'] =~ platform_regex} end + #Return '--waitforlock 1' if the agent is >= 6.16 which was used in 2019.8.0. + def waitforlock_flag + version_is_less(master['pe_ver'], '2019.8.0') ? '' : '--waitforlock 1' + end + # Generate the command line string needed to from a frictionless puppet-agent # install on this host in a PE environment. # # @param [Host] host The host to install puppet-agent onto # @param [Hash] opts The full beaker options @@ -724,11 +729,11 @@ end # waitforlock in case stopping the agent run after stopping the agent service # takes a little longer than usual step "Run puppet to setup mcollective and pxp-agent" do - on(master, puppet_agent('-t --waitforlock 1'), :acceptable_exit_codes => [0,2]) + on(master, puppet_agent("-t #{waitforlock_flag}"), :acceptable_exit_codes => [0,2]) end install_agents_only_on(agents, opts) step "Run puppet a second time on the primary to populate services.conf (PE-19054)" do @@ -975,11 +980,11 @@ step "First puppet agent run" do # Run the agent once to ensure everything is in the dashboard install_hosts.each do |host| # waitforlock in case stopping the agent run after stopping the agent service # takes a little longer than usual - on host, puppet_agent('-t --waitforlock 1'), :acceptable_exit_codes => [0,2] + on host, puppet_agent("-t #{waitforlock_flag}"), :acceptable_exit_codes => [0,2] # Workaround for PE-1105 when deploying 3.0.0 # The installer did not respect our database host answers in 3.0.0, # and would cause puppetdb to be bounced by the agent run. By sleeping # again here, we ensure that if that bounce happens during an upgrade @@ -1016,11 +1021,11 @@ # Now that all hosts are in the dashbaord, run puppet one more # time to configure mcollective install_hosts.each do |host| # waitforlock in case stopping the agent run after stopping the agent service # takes a little longer than usual - on host, puppet_agent('-t --waitforlock 1'), :acceptable_exit_codes => [0,2] + on host, puppet_agent("-t #{waitforlock_flag}"), :acceptable_exit_codes => [0,2] # To work around PE-14318 if we just ran puppet agent on the # database node we will need to wait until puppetdb is up and # running before continuing if host == database && ! pre30database sleep_until_puppetdb_started(database) @@ -2121,10 +2126,10 @@ end # waitforlock in case stopping the agent run after stopping the agent service # takes a little longer than usual step "Run puppet on all agent nodes" do - on agent_nodes, puppet_agent('-t --waitforlock 1'), :acceptable_exit_codes => [0,2], :run_in_parallel => true + on agent_nodes, puppet_agent("-t #{waitforlock_flag}"), :acceptable_exit_codes => [0,2], :run_in_parallel => true end #Workaround for windows frictionless install, see BKR-943 agent_nodes.select {|agent| agent['platform'] =~ /windows/}.each do |agent| remove_client_datadir(agent)