Jira (BOLT-1540) Exit code handling in Tasks

5 views
Skip to first unread message

Mike Smith (Jira)

unread,
Mar 9, 2020, 6:33:04 PM3/9/20
to puppe...@googlegroups.com
Mike Smith created an issue
 
Puppet Task Runner / Improvement BOLT-1540
Exit code handling in Tasks
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: bolt
Created: 2020/03/09 3:32 PM
Labels: bolt
Priority: Normal Normal
Reporter: Mike Smith

The experience of users in a Walmart Bolt workshop found users experimenting with error handling.  The group was very Ansible friendly and comparing features 1:1. They are mostly CLI users without access to enterprise tooling. They took a script and changed a command within the script to intentionally be wrong. 

Bolt script run - errors out.

Bolt task run - success (no error).

This experience is different than Ansible in that it will fail in both cases if the underlying script is bad. The Puppet docs mention "error handing" in tasks, but don't explain that is required to get error information https://puppet.com/docs/bolt/latest/writing_tasks.html#returning-errors-in-tasks . 

The expected behavior is that if a script fails a task that runs that script will also fail without introducing new code to handle specific errors.     

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Ryan RussellYates (Jira)

unread,
Mar 9, 2020, 7:13:05 PM3/9/20
to puppe...@googlegroups.com
Ryan RussellYates commented on Improvement BOLT-1540
 
Re: Exit code handling in Tasks

I'd think it'd be best to add a field into the JSON files that allows tasks to be passed or failed based on output to Stderr. By default, if something goes back to stderr the task should fail (This would be what our ops-focused users would expect from this functionality).

 

"You should build case statements into every script you write with exit code handling" is not the way to win over Ansible users. In some cases, actions can be noisy and an output to stderr may not mean the script should fail, give us a toggle for it! But making it the default case means I can't trust tasks that my organization produces.

Jarret Lavallee (Jira)

unread,
May 7, 2020, 4:26:03 PM5/7/20
to puppe...@googlegroups.com
Jarret Lavallee updated an issue
 
Change By: Jarret Lavallee
CS Priority: Needs Priority Reviewed
Reply all
Reply to author
Forward
0 new messages