Jira (PUP-9324) Puppet agent run output to differentiate between corrective and intentional change

6 views
Skip to first unread message

Geoff Nichols (JIRA)

unread,
Nov 19, 2018, 1:21:02 PM11/19/18
to puppe...@googlegroups.com
Geoff Nichols moved an issue
 
Puppet / New Feature PUP-9324
Puppet agent run output to differentiate between corrective and intentional change
Change By: Geoff Nichols
Key: PA PUP - 2320 9324
Project: Puppet Agent
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Jorie Tappa (JIRA)

unread,
Nov 19, 2018, 4:53:03 PM11/19/18
to puppe...@googlegroups.com
Jorie Tappa commented on New Feature PUP-9324
 
Re: Puppet agent run output to differentiate between corrective and intentional change

We could use more information around what would be involved in this feature. Do you currently have a script to workaround the functionality that's missing here?

Charlie Sharpsteen (JIRA)

unread,
Nov 20, 2018, 11:50:01 AM11/20/18
to puppe...@googlegroups.com

Jorie Tappa In this case, the customer that requested the feature wants something that is as close to "realtime" as possible. They would rather parse the information directly from the syslog stream than wait for the report to make its way up to a puppet server and then through the report processor.

Jarret Lavallee (JIRA)

unread,
Nov 29, 2018, 3:58:03 PM11/29/18
to puppe...@googlegroups.com

I did some investigation into this issue and it seems like the change would be relatively easy to implement, however, I am not sure on the scope of the impact on implementing the change.

To make a change to the logging, we can determine if the change is corrective or intentional prior to sending the log at https://github.com/puppetlabs/puppet/blob/5.5.x/lib/puppet/transaction/resource_harness.rb#L161-L163.

A simple edit to this on an agent with the following ternary enabled this change. However, if we were to implement this, we may want it to be optional with a config option to minimize the impact.

if event
  name = param.name.to_s
  event.message ||= _("could not create change error message for %{name}") % { name: name }
  event.calculate_corrective_change(@persistence.get_system_value(context.resource.ref, name))
  event.message = event.corrective_change ? event.message + ' (corrective)' : event.message + ' (intentional)'
  context.record(event)
  event.send_log
  context.synced_params << param.name
end

The resulting output is as follows.

Notice: /Stage[main]/Test/File[/tmp/test]/ensure: defined content as '{md5}d96f3a8a11eebb06a99e8127833f5d1e' (intentional)

Notice: /Stage[main]/Test/File[/tmp/test]/ensure: defined content as '{md5}d96f3a8a11eebb06a99e8127833f5d1e' (corrective)

I ran the change through spec tests and at least 42 tests are now failing. I am uncertain what other acceptance tests would depend on the logging, and if there is a better place and way to make this change.

An alternative implementation would be to log differently on corrective changes, which is less impactful.

event.calculate_corrective_change(@persistence.get_system_value(context.resource.ref, name))
event.message << ' (corrective)' if event.corrective_change

The code above results in no failed tests, so it may be an easy change given we add tests for corrective changes.

Halim Wijaya (JIRA)

unread,
Dec 9, 2018, 8:35:04 PM12/9/18
to puppe...@googlegroups.com
Halim Wijaya updated an issue
 
Change By: Halim Wijaya
Comment: A comment with security level 'Developers' was removed.

Eric Sorenson (JIRA)

unread,
Dec 12, 2018, 4:41:04 PM12/12/18
to puppe...@googlegroups.com
Eric Sorenson commented on New Feature PUP-9324
 
Re: Puppet agent run output to differentiate between corrective and intentional change

I rather like jarrett's second suggestion - just to flag the corrective changes rather than all changes. This seems like a low effort / low risk way to solve the problem.

Thomas Honey (JIRA)

unread,
Jan 7, 2019, 9:33:03 AM1/7/19
to puppe...@googlegroups.com
Thomas Honey commented on New Feature PUP-9324

From a testing perspective there are generally 2 kinds of tests run. 

  • Puppet apply, check for where there errors.  status IE puppet returns a non zero status code if there was an error.
  • Run puppet apply with detailed exit codes. puppet returns a non zero status code if there was a change made.

There may be some tests that check for specific changes, eg

expect(apply_manifest(pp, expect_failures: true).first['result']['stderr']).to match(%r{change from '?directory'? to '?file'? failed})

I think that the enhanced functionality is worth the change. I think that it will affect testing in modules!  but it should be a small number of tests affected.

We could grep through supported modules to find the size of this change.

Melissa Stone (JIRA)

unread,
Jan 10, 2019, 4:31:05 PM1/10/19
to puppe...@googlegroups.com

Melissa Stone (JIRA)

unread,
Jan 10, 2019, 4:48:05 PM1/10/19
to puppe...@googlegroups.com

Melissa Stone (JIRA)

unread,
Jan 10, 2019, 4:48:05 PM1/10/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Jan 14, 2019, 6:22:04 PM1/14/19
to puppe...@googlegroups.com

Melissa Stone (JIRA)

unread,
Jan 15, 2019, 5:45:06 PM1/15/19
to puppe...@googlegroups.com
Melissa Stone commented on New Feature PUP-9324
 
Re: Puppet agent run output to differentiate between corrective and intentional change

We've decided to move forward with Jarret Lavallee's PR as it is. We just need to figure out any coordination with the modules team in case this causes test failures there.

David Mallon (JIRA)

unread,
Jan 16, 2019, 8:54:03 AM1/16/19
to puppe...@googlegroups.com
David Mallon commented on New Feature PUP-9324

Hey Melissa Stone, first off, thanks for the heads up on this change, the Modules team can plan some testing around this to make sure things are good on our side. If possible we would like to :

1. Get access to a nightly Agent build with the change
2. Modules team will test against each of our supported modules
3. If there are issues in any modules we will merge our test fixes to master - no need for a release
4. Let you guys know when we are good to go
5. You guys can proceed with the Agent release with that change.

Does that work for you guys?

Melissa Stone (JIRA)

unread,
Jan 16, 2019, 1:30:04 PM1/16/19
to puppe...@googlegroups.com
Melissa Stone commented on New Feature PUP-9324

That works for me, thank you! I'll coordinate this change and update both here and in FM-7682 when we have agent builds in the different streams that contain this change

Josh Cooper (JIRA)

unread,
Jan 16, 2019, 1:38:06 PM1/16/19
to puppe...@googlegroups.com

Melissa Stone (JIRA)

unread,
Jan 16, 2019, 1:53:04 PM1/16/19
to puppe...@googlegroups.com
Melissa Stone updated an issue
 
Change By: Melissa Stone
Release Notes Summary: Corrective changes in the logs are now explicitely called out as corrective.
Release Notes: Enhancement

Melissa Stone (JIRA)

unread,
Jan 22, 2019, 12:55:07 PM1/22/19
to puppe...@googlegroups.com
Melissa Stone commented on New Feature PUP-9324
 
Re: Puppet agent run output to differentiate between corrective and intentional change

This has passed ci for the 5.5.x branch with puppet-agent 5.5.10.27.g53d8298

Melissa Stone (JIRA)

unread,
Jan 23, 2019, 2:12:04 PM1/23/19
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
Fix Version/s: PUP 6.0.6
Fix Version/s: PUP 6.2.1
Fix Version/s: PUP 6.1.z

Melissa Stone (JIRA)

unread,
Jan 25, 2019, 3:07:03 PM1/25/19
to puppe...@googlegroups.com
Melissa Stone commented on New Feature PUP-9324
 
Re: Puppet agent run output to differentiate between corrective and intentional change

And this has passed ci for the 6.0.x branch with puppet-agent 6.0.5.93.geeb6eb5

Melissa Stone (JIRA)

unread,
Jan 25, 2019, 3:09:04 PM1/25/19
to puppe...@googlegroups.com

Halim Wijaya (JIRA)

unread,
Jan 29, 2019, 8:43:03 PM1/29/19
to puppe...@googlegroups.com
Halim Wijaya commented on New Feature PUP-9324
 
Re: Puppet agent run output to differentiate between corrective and intentional change

Thanks Melissa Stone for the quick turnaround on this.

There is a question from customer if there is a plan to backport this to current LTS?

Eric Sorenson (JIRA)

unread,
Jan 30, 2019, 7:17:05 AM1/30/19
to puppe...@googlegroups.com

David Swan (JIRA)

unread,
Feb 4, 2019, 8:57:04 AM2/4/19
to puppe...@googlegroups.com
David Swan commented on New Feature PUP-9324

Melissa Stone Have been running the agent against all of our modules and it's been going great except for one thing. We are getting consistent failures on are task modules on all windows machines when run on 2018.1.

We are getting the error, 

```

bash: /cygdrive/c/Program Files/Puppet Labs/Puppet/sys/ruby/bin/bolt.bat: No such file or directory

```

Was wondering if you could think of any reason we may be seeing this.

Sorry to be a bother.

Melissa Stone (JIRA)

unread,
Feb 4, 2019, 1:44:03 PM2/4/19
to puppe...@googlegroups.com
Melissa Stone commented on New Feature PUP-9324

David Swan no bother!

 

Have you confirmed the agent version that's getting pulled in with your tests contains this change? I'm not very familiar with the modules pipelines, but from my brief encounter with them, I remember it was a little confusing figuring out how it figured out which puppet-agent version to install.

 

And without knowing much about where that 2018.1 failure is happening, I can only speculate on why it's failing. However, I don't think it's related to the changes associated with this ticket. It's possible you're hitting some automation that loops through all our projects (facter, puppet, etc) to look for bat files that should be created at install time. Someone possibly added bolt to that list without updating the automation that builds the MSI to create that file. I have no idea if this is an issue with PE or with the puppet-agent package though. You should open either a PE or a PA ticket with more details on the failure, and those folks can track it down further. Include links to the failing jobs too. That'll help with figuring out what's going on.

Jean Bond (JIRA)

unread,
Feb 19, 2019, 1:53:03 PM2/19/19
to puppe...@googlegroups.com

Austin Boyd (JIRA)

unread,
Dec 12, 2019, 8:51:05 AM12/12/19
to puppe...@googlegroups.com
Austin Boyd updated an issue
Change By: Austin Boyd
Zendesk Ticket IDs: 32715
Zendesk Ticket Count: 1
Reply all
Reply to author
Forward
0 new messages