Skip to content

fix(inputs.puppetagent): Update default summary path in puppetagent#19257

Open
Mihitoko wants to merge 2 commits into
influxdata:masterfrom
Mihitoko:update-path-for-puppetagent-plugin
Open

fix(inputs.puppetagent): Update default summary path in puppetagent#19257
Mihitoko wants to merge 2 commits into
influxdata:masterfrom
Mihitoko:update-path-for-puppetagent-plugin

Conversation

@Mihitoko

Copy link
Copy Markdown

Summary

This fixes #19256.
Update the path to the new default to make it clear which file is meant.
I also added a hint to necessary puppet config adjustments to get the plugin to work correctly.

Checklist

Related issues

resolves #19256

@telegraf-tiger telegraf-tiger Bot added docs Issues related to Telegraf documentation and configuration descriptions plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Jul 12, 2026
@Mihitoko Mihitoko force-pushed the update-path-for-puppetagent-plugin branch from 31bffee to 0f774fb Compare July 12, 2026 17:36
@Mihitoko

Copy link
Copy Markdown
Author

Note: the previous lint job failed and from the build output it tried to post a comment.
But Github returned 403, looks like something is wrong with the configured token.
https://github.com/influxdata/telegraf/actions/runs/29201933211/job/86674674958#step:4:175

@skartikey skartikey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plugins/inputs/puppetagent/puppetagent.go:89-90 - the plugin still falls back to the old path (/var/lib/puppet/state/last_run_summary.yaml) when location is not set, so after this PR the documented example and the actual default behavior diverge: a user with a bare [[inputs.puppetagent]] section gets the old path while the docs show the new one. Please update the fallback in Init in this same PR to the same value the sample shows, and given that the official AIO packages default publicdir to /opt/puppetlabs/puppet/public (PUP-10627) and are how most Puppet 7/8 deployments are installed, I would make that shared value /opt/puppetlabs/puppet/public/last_run_summary.yaml (see item 2). Since this changes behavior the PR should then be retitled fix(inputs.puppetagent): .... The risk window is small: on any Puppet 7+ host the old fallback already fails with a stat error, and Puppet 6 is long EOL.

Comment thread plugins/inputs/puppetagent/sample.conf Outdated
## Location of puppet last run summary file
location = "/var/lib/puppet/state/last_run_summary.yaml"
## Location of Puppet last run summary file (Puppet default: $publicdir/last_run_summary.yaml)
location = "/var/cache/puppet/public/last_run_summary.yaml"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the concrete example uses the distro-packaged flavor (/var/cache/puppet/public/...); per item 1 I would switch it to the AIO path /opt/puppetlabs/puppet/public/last_run_summary.yaml. The $publicdir parenthetical already covers users on other packagings; if desired, a single README prose line can mention the distro-packaged variant.

@skartikey skartikey self-assigned this Jul 13, 2026
@Mihitoko Mihitoko force-pushed the update-path-for-puppetagent-plugin branch from 0f774fb to 2c467cb Compare July 13, 2026 19:24
@Mihitoko Mihitoko changed the title docs(inputs.puppetagent): Adjust summary path to new default fix(inputs.puppetagent): Update default summary path in puppetagent Jul 13, 2026
@Mihitoko Mihitoko changed the title fix(inputs.puppetagent): Update default summary path in puppetagent fix(inputs.puppetagent): Update default summary path in puppetagent Jul 13, 2026
@Mihitoko Mihitoko changed the title fix(inputs.puppetagent): Update default summary path in puppetagent fix(inputs.puppetagent): Update default summary path in puppetagent Jul 13, 2026
@telegraf-tiger telegraf-tiger Bot added the fix pr to fix corresponding bug label Jul 13, 2026
@telegraf-tiger

Copy link
Copy Markdown
Contributor

@Mihitoko

Copy link
Copy Markdown
Author

Hey 👋
Thanks for the fast review <3
I adjusted the pr according to your comments, please let me know if there is more to change

Also i decided to make the statement more generic by saying that $publicdir might be different rather then hard mentioning the path the debian package uses, because it really seems highly dependent on how the distro packages puppet.

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @Mihitoko! Unfortunately, we cannot update the default location as we try do guarantee backward compatibility in Telegraf and your change would break everyone using a Puppet version before 7!

What I would like to see instead is a comment in the sample.conf file saying

  ## Location of puppet last run summary file
  ## Use the following path for puppet version 7+ ($publicdir/last_run_summary.yaml)
  ##   location = "/opt/puppetlabs/puppet/public/last_run_summary.yaml"
  # location = "/var/lib/puppet/state/last_run_summary.yaml"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Issues related to Telegraf documentation and configuration descriptions fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inputs.puppetagent: Adjust path to new default introduced in puppet7

3 participants