(MODULES-11858) Restore Puppet 7 support broken by 10.6.2#1686
Merged
Conversation
ekohl
reviewed
Jul 7, 2026
10.6.2 (PR #1646, "CAT-2385 Puppetcore update") bumped .rubocop.yml TargetRubyVersion to 3.1, so `rubocop -A` rewrote hash literals to Ruby 3.1 shorthand (`salt:` instead of `salt: salt`) in three custom functions/providers. That shorthand is a hard syntax error on Ruby < 3.1, and Puppet 7 ships Ruby 2.7 -- so any Puppet 7 catalog using postgresql::postgresql_password, postgresql_conf or postgresql_replication_slot failed to compile with "syntax error, unexpected ','" (issue #1685). Fix the Ruby side so existing Puppet 7 installations keep working: - .rubocop.yml: TargetRubyVersion back to '2.6' so autocorrect can't reintroduce the shorthand. - Revert the Ruby 3.1 shorthand hash syntax in the three lib files (keeping the unrelated postgresql_conf entry_regex bugfix from #1657). - Revert the same shorthand autocorrection in four spec files so they parse under the 2.6 target. Verified with `pdk validate`, the full unit suite (685 examples, 0 failures), and Litmus end-to-end applies on both Puppet 7.34/Ruby 2.7 and Puppet 8.10/Ruby 3.2 (install, idempotency, and a SCRAM-SHA-256 password hash stored in the live database). Fixes #1685 Co-Authored-By: Claude <noreply@anthropic.com>
fb5140d to
01eab72
Compare
ekohl
approved these changes
Jul 7, 2026
ekohl
left a comment
Collaborator
There was a problem hiding this comment.
Untested, but from a first glance this looks correct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1685 (MODULES-11858).
10.6.2was tagged a patch but PR #1646 (CAT-2385 Puppetcore update) introduced a hard syntax error that breaks existing installations on Puppet 7..rubocop.ymlbumpedTargetRubyVersionto3.1, sorubocop -Arewrote hash literals to Ruby 3.1 shorthand (salt:instead ofsalt: salt) in three custom functions/providers. That shorthand is a syntax error on Ruby 2.7 — the Ruby that Puppet 7 ships — so any Puppet 7 catalog usingpostgresql::postgresql_password,postgresql_conf, orpostgresql_replication_slotfails to compile withsyntax error, unexpected ','(#1685).What this PR does
Reverts only the Ruby-side breakage:
postgresql_password.rb,postgresql_conf/ruby.rb,postgresql_replication_slot/ruby.rbpostgresql_confentry_regexbugfix from #1657).rubocop.ymlTargetRubyVersionback to'2.6'so autocorrect can't reintroduce the shorthand2.6targetThe puppet requirement in
metadata.jsonis left at>= 8.0.0per review — this PR is scoped to the Ruby syntax fix only. The puppetcore8Gemfile/CI changes from #1646 also stay in place (dev/test only, not consumer-facing).Testing
pdk validate→ clean (exit 0)postgresql::serverinstall → idempotent second run,testdbcreated, and a SCRAM-SHA-256 password hash written to the live database (the exactdigest_keypath that was crashing).🤖 Generated with Claude Code