lib/bolt/pal.rb
# PALError is used to convert errors from executing puppet code into
# Bolt::Errors
PALError is used to convert errors from executing puppet code into
Bolt::Errors
PALError is used to convert errors from executing puppet code into Bolt :: Errors
def run_plan(plan_name, params, executor, inventory = nil, pdb_client = nil, applicator = nil)
      in_plan_compiler(executor, inventory, pdb_client, applicator) do |compiler|
         Every future except for the main plan needs to have a plan id in
         order to be tracked for the `wait()` function with no arguments.
        future = executor.create_future(name: plan_name, plan_id: 0) do |_scope|
          r = compiler.call_function('run_plan', plan_name, params.merge('_bolt_api_call' => true))
          Bolt::PlanResult.from_pcore(r, 'success')
        rescue Bolt::Error => e
          Bolt::PlanResult.new(e, 'failure')
        end
         Round robin until all Fibers, including the main plan, have finished.
         This will stay alive until backgrounded tasks have finished.
        executor.round_robin until executor.plan_complete?
         Return the result from the main plan
        future.value
      end
    rescue Bolt::Error => e
      Bolt::PlanResult.new(e, 'failure')
    end
def run_plan ( plan_name , params , executor , inventory = nil , pdb_client = nil , applicator = nil ) in_plan_compiler ( executor , inventory , pdb_client , applicator ) do | compiler | future = executor . create_future ( name : plan_name , plan_id : 0 ) do | _scope | r = compiler . call_function ( 'run_plan' , plan_name , params . merge ( '_bolt_api_call' => true ) ) Bolt :: PlanResult . from_pcore ( r , 'success' ) rescue Bolt :: Error => e Bolt :: PlanResult . new ( e , 'failure' ) end executor . round_robin until executor . plan_complete? future . value end rescue Bolt :: Error => e Bolt :: PlanResult . new ( e , 'failure' ) end
PALError is used to convert errors from executing puppet code into
Bolt::Errors
PALError is used to convert errors from executing puppet code into Bolt :: Errors
# Start the round robin inside the plan compiler, so that # backgrounded tasks can finish once the main plan exits # Create a Fiber for the main plan. This will be run along with any # other Fibers created during the plan run in the round_robin, with the # main plan always taking precedence in being resumed. # # Every future except for the main plan needs to have a plan id in # order to be tracked for the `wait()` function with no arguments. # Round robin until all Fibers, including the main plan, have finished. # This will stay alive until backgrounded tasks have finished. # Return the result from the main plan
plan_name
<not_specific>
params
<not_specific>
executor
<not_specific>
inventory
<not_specific>
pdb_client
<not_specific>
applicator
<not_specific>