Jira (PUP-686) --detailed-exit-codes not honored when --noop is used

3 views
Skip to first unread message

Rob Nelson (JIRA)

unread,
Dec 4, 2014, 7:05:28 PM12/4/14
to puppe...@googlegroups.com
Rob Nelson commented on New Feature PUP-686
 
Re: --detailed-exit-codes not honored when --noop is used

The redmine ticket suggests this be put in the 3.x branch. Is that still correct, or will this be deferred to 4.x?

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.3.7#6337-sha1:2ed701e)
Atlassian logo

Charlie Sharpsteen (JIRA)

unread,
Dec 4, 2014, 7:10:27 PM12/4/14
to puppe...@googlegroups.com

It will have to be 4.x, since this is a new feature. However, we still need to make a decision as to whether this is the right thing to do.

Gareth Rushgrove (JIRA)

unread,
Dec 5, 2014, 3:27:27 AM12/5/14
to puppe...@googlegroups.com

With regards whether this is the right thing to do, I wanted to do this just a few days ago.

My usecase was using noop for auditing, watching for changes and throwing an error if any where found.

I found the existing experience surprising.

I ended up doing something horrible with --lastrunfile, --postrun_command and this shell script:

https://github.com/puppetlabs/puppetlabs-aws/blob/master/examples/audit-security-groups/count_out_of_sync_resources.sh

Andrew Kerr (JIRA)

unread,
Jan 3, 2015, 9:53:25 AM1/3/15
to puppe...@googlegroups.com
Andrew Kerr commented on New Feature PUP-686

I would also very much appreciate this feature, and I absolutely think it is the right approach. My use case is that I'd like to run puppet on a sensitive production machine, but not actually change anything since it requires approval. If the exit code indicates that changes would have been made, which is what you'd expect --detailed-exitcodes do to even now, then I'd like to trigger a monitoring alert and have the owner of the machine fix the issue.

Is there reason / use case where you'd add --detailed-exitcodes and --noop and NOT expect the exit code to reflect the run results?

This message was sent by Atlassian JIRA (v6.3.10#6340-sha1:7ea293a)
Atlassian logo

Charlie Sharpsteen (JIRA)

unread,
Dec 8, 2015, 7:14:02 PM12/8/15
to puppe...@googlegroups.com
Charlie Sharpsteen assigned an issue to Unassigned
 
Puppet / New Feature PUP-686
Change By: Charlie Sharpsteen
Assignee: Charlie Sharpsteen
Scrum Team: Client Platform
This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc)
Atlassian logo

Tim Abbott (JIRA)

unread,
Aug 9, 2016, 1:09:05 PM8/9/16
to puppe...@googlegroups.com
Tim Abbott commented on New Feature PUP-686
 
Re: --detailed-exit-codes not honored when --noop is used

I would also find this feature super useful; it's exactly what you'd want to (for example) have an auditing/monitoring/Nagios check for whether a machine is up to date with a set of puppet manifests.

And I agree with the other posters that if you pass `--noop --detailed-exitcodes`, this is the only reasonable interpretation of what exit status you want.

This message was sent by Atlassian JIRA (v6.4.13#64028-sha1:b7939e9)
Atlassian logo

Tim Abbott (JIRA)

unread,
Aug 9, 2016, 9:18:03 PM8/9/16
to puppe...@googlegroups.com
Tim Abbott updated an issue
 
Change By: Tim Abbott
According to the man page,

>--detailed-exitcodes
>   Provide transaction information via exit codes. If this is enabled, an exit code of '2' means there were changes, an exit code of '4' means there were failures during the transaction, and an exit code of '6' means there were >   both changes and failures.

If --noop is used, puppet always returns with an exit code of 0.

While technically correct, as nothing changed, it is not the expected result nor is it terribly useful.

Puppet should return 0 if nothing would have changed, 2 if something would have changed, 4 if errors and 6 if potential changes and errors when ran with --noop.

David Kramer (JIRA)

unread,
Aug 17, 2016, 12:56:07 PM8/17/16
to puppe...@googlegroups.com
David Kramer updated an issue
Change By: David Kramer
Sprint: Client Triage

Kenn Hussey (JIRA)

unread,
Sep 29, 2016, 2:59:15 PM9/29/16
to puppe...@googlegroups.com
Kenn Hussey updated an issue
Change By: Kenn Hussey
Sprint: Client Triage
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Eric Thompson (JIRA)

unread,
Oct 7, 2016, 3:43:04 PM10/7/16
to puppe...@googlegroups.com
Eric Thompson updated an issue
Change By: Eric Thompson
Team: Agent & Platform

Sean McDonald (JIRA)

unread,
May 16, 2017, 1:16:03 PM5/16/17
to puppe...@googlegroups.com
Sean McDonald updated an issue
Change By: Sean McDonald
Labels: customer redmine  triaged

Moses Mendoza (JIRA)

unread,
May 18, 2017, 1:49:37 PM5/18/17
to puppe...@googlegroups.com
Moses Mendoza updated an issue
Change By: Moses Mendoza
Labels: customer redmine  triaged

Naeem (JIRA)

unread,
Dec 11, 2017, 6:17:04 PM12/11/17
to puppe...@googlegroups.com
Naeem commented on New Feature PUP-686
 
Re: --detailed-exit-codes not honored when --noop is used

Agreed, that this would be a really useful feature for auditing, monitoring purposes.

This request has been created more than 4 years ago. Is is possible to get an ETA on this?

This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

Deniss Dolbenovs (JIRA)

unread,
Jan 15, 2018, 8:01:16 AM1/15/18
to puppe...@googlegroups.com

Michele Baldessari (JIRA)

unread,
Feb 21, 2018, 9:48:02 AM2/21/18
to puppe...@googlegroups.com

Here is an initial pass at fixing this: https://github.com/puppetlabs/puppet/pull/6660 . First puppet patch, so appreciate feedback.

This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)
Atlassian logo

Jacob Helwig (JIRA)

unread,
May 17, 2018, 5:21:03 PM5/17/18
to puppe...@googlegroups.com
Jacob Helwig assigned an issue to Jacob Helwig
 
Change By: Jacob Helwig
Assignee: Jacob Helwig
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Branan Riley (JIRA)

unread,
May 23, 2018, 6:34:04 PM5/23/18
to puppe...@googlegroups.com
Branan Riley commented on New Feature PUP-686
 
Re: --detailed-exit-codes not honored when --noop is used

Making 2 indicate that noop resources are out-of-sync would make mixed-noop situations ambiguous in the exit code. Perhaps we should introduce 8 to indicate that there are noop resources that want to be changed? (which of course can be combined with the existing 1, 2, and 4)

Jacob Helwig (JIRA)

unread,
May 24, 2018, 11:28:03 AM5/24/18
to puppe...@googlegroups.com
Jacob Helwig commented on New Feature PUP-686

I'm in favor of Branan Riley's suggestion of using 8 in the exit bitmask to indicate that a noop resource is out of sync, as we can use that even when --noop isn't used, and there are "noop => true" resources in the catalog.

Rob Nelson (JIRA)

unread,
May 24, 2018, 12:49:04 PM5/24/18
to puppe...@googlegroups.com
Rob Nelson commented on New Feature PUP-686

I think 8 sounds fine for a noop run. When in a yesop run but with noop resources that changed, what would the return code be, 2 or 8?

Jacob Helwig (JIRA)

unread,
May 24, 2018, 12:53:02 PM5/24/18
to puppe...@googlegroups.com
Jacob Helwig commented on New Feature PUP-686

Depends on what else is in the catalog. The exit code from --detailed-exit-codes is actually a bitmask, so if the resource that was out of sync was noop => true it would set bit 4 (integer 8), if the resource is not noop then it'll set bit 2 (integer 2), so if there were both noop, and non-noop resources that were out of sync, it would have both bits set, and be an exit code of 10.

Rob Nelson (JIRA)

unread,
May 24, 2018, 1:00:03 PM5/24/18
to puppe...@googlegroups.com

Alvin Rodis (Jira)

unread,
Apr 20, 2022, 5:44:01 AM4/20/22
to puppe...@googlegroups.com
Alvin Rodis updated an issue
 
Change By: Alvin Rodis
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 48124
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Alvin Rodis (Jira)

unread,
Apr 20, 2022, 5:44:03 AM4/20/22
to puppe...@googlegroups.com
Alvin Rodis updated an issue
Change By: Alvin Rodis
Labels: customer jira_escalated redmine
Reply all
Reply to author
Forward
0 new messages