bolt icon indicating copy to clipboard operation
bolt copied to clipboard

unable to use _catch_errors for apply_prep function in puppet plan

Open srikanth2302 opened this issue 1 year ago • 3 comments

Describe the Bug

apply_prep function unable to catch errors to go further in a plan. It says 'apply_prep' expects 1 argument, got 2"

Expected Behavior

apply_prep function needs to catch error so that even if 1/10 nodes failed need to proceed further tasks in a plan.

Steps to Reproduce

Tried below ways to catch errors in apply_prep function

Method 1: $apply_prep_result = apply_prep($target_nodes, { '_catch_errors' => true }) Method 2: $apply_prep_result = apply_prep($target_nodes,'_catch_errors' => true)

Environment

  • Version - Puppet Enterprise 2021.7
  • Platform - Ubuntu 20.04

srikanth2302 avatar Apr 01 '24 10:04 srikanth2302

Bolt supports this as of https://github.com/puppetlabs/bolt/commit/9dcbd88a5661ffff42a60107c2f517d4249d0958 . I'm assuming you are not running this plan through bolt as a system package or gem, but rather through the orchestrator in PE?

donoghuc avatar Apr 01 '24 15:04 donoghuc

Yes.. This Plan is run via PE Console and not through any bolt commands.

srikanth2302 avatar Apr 01 '24 15:04 srikanth2302

Can this be feasible to get ResultSet Info as well Instead of BoltResultSet for apply_prep() to run via orchestrator PE Console Plan

srikanth2302 avatar Apr 04 '24 09:04 srikanth2302