Skip to content

Conversation

jeremie-pierson
Copy link

This pull request is intended to fix #169 . Also this is my first pull request on github.

Currently, if a file has a content attribute set to something that looks like a checksum, it will display a deprecation warning and then probably throw an error, as the checksum-like string won't match anything in filebuckets.

This code is apparently intended to allow a checksum to be passed instead of actual content, with the effect of replacing file content if it doesn't match the checksum. It appears that this mecanism is replaced by "static catalogs" and was scheduled for removal in Puppet 7.

As it is no longer documented (because deprecated), it is surprising to stumble upon the behavior by just having file content that looks like a checksum. I had to work around this in a real usecase involving some proprietary software that uses the same syntax for values to be encrypted at startup.

This commit introduces a new setting "use_checksum_in_file_content" that default to true, preserving current behavior. If set to false, it will never look for checksums in file contents.

This setting should probably be set to false by default in the next major release.

Currently, if a file has a content attribute set to something that looks
like a checksum, it will display a deprecation warning and then probably
throw an error, as the checksum-link string won't match anything in
filebuckets.

This code is apparently intended to allow a checksum to be passed instead
of actual content, with the effect of replacing file content if it
doesn't match the checksum. It appears that this mecanism is replaced by
"static catalogs" and was scheduled for removal in Puppet 7.

As it is no longer documented (because deprecated), it is surprising to
stumble upon the behavior by just having file content that looks like a
checksum. I had to work around this in a real usecase involving some
proprietary software that uses the same syntax for value to be encrypted
at startup.

This commit introduces a new setting "use_checksum_in_file_content" that
default to true, preserving current behavior. If set to false, it will
never look for checksums in file contents.

This setting should probably be set to false by default in the next
major release.
@jeremie-pierson
Copy link
Author

I'll correct the new rubocop offense.

This is a bit less nice because the nested if allowed another comment,
but hey, Rubocop.
@jeremie-pierson jeremie-pierson marked this pull request as draft August 21, 2025 15:29
@jeremie-pierson
Copy link
Author

@bastelfreak Should I add some tests ?

@jeremie-pierson jeremie-pierson marked this pull request as ready for review August 25, 2025 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: lines in file resource content looking like a checksum throws an error
1 participant