puppetlabs / bolt

Bolt is an open source orchestration tool that automates the manual work it takes to maintain your infrastructure on an as-needed basis or as part of a greater orchestration workflow. It can be installed on your local workstation and connects directly to remote nodes with SSH or WinRM, so you are not required to install any agent software.
https://puppet.com/docs/bolt/latest/bolt.html
Apache License 2.0
500 stars 225 forks source link

unable to use _catch_errors for apply_prep function in puppet plan #3290

Open srikanth2302 opened 7 months ago

srikanth2302 commented 7 months ago

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

donoghuc commented 7 months ago

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?

srikanth2302 commented 7 months ago

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

srikanth2302 commented 7 months ago

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