Skip to content

Modernize for Puppet 8 - #4

Merged
dsundq merged 6 commits into
Ericsson:masterfrom
dsundq:modernize-pdk-puppet8
Nov 17, 2026
Merged

dsundq merged 6 commits into
Ericsson:masterfrom
dsundq:modernize-pdk-puppet8

Conversation

@dsundq

@dsundq dsundq commented Nov 17, 2026

Copy link
Copy Markdown

Summary

Bring the module up to a current Puppet 8 / PDK baseline.

  • Upgrade to PDK 3.4.0
  • metadata.json: Puppet >= 8.0.0 < 9.0.0, stdlib >= 9.0.0 < 11.0.0
  • OS support: RedHat/Rocky 8, 9, 10, SLES 12, 15, Ubuntu 20.04, 22.04, 24.04,
    Debian 11, 12 (drops EL5-7, CentOS and old Debian/Ubuntu releases)
  • Replace create_resources with .each and hiera_hash with lookup
    (same hash merge behaviour for sysctl::base::values)
  • Convert the sysctl.d template from ERB to EPP
  • Add REFERENCE.md (puppet-strings) and rewrite README
  • CI: drop the Puppet 7 workflow, bump actions/checkout to v5

Breaking changes

  • Puppet 7 and older are no longer supported.
  • stdlib 9 or later is required.

Testing

  • pdk validate: clean
  • pdk test unit: 166 examples, 0 failures
  • pdk update --noop: no changes required
  • REFERENCE.md regenerated, no diff

Set template-url to the internal pdk-templates repo (3.4.0.3) and ran
a real "pdk update --force". template-ref is now
tags/3.4.0.3-0-g8fb22fc. .sync.yml is unchanged (coverage_report true,
minimum_code_coverage_percentage 100).

Verification run:
- pdk update --noop: No changes required
- pdk validate: exit 0, no findings
- pdk test unit: 57 examples, 0 failures, 100% resource coverage
  (was 183 on the old template; see note)

Note: the example count dropped from 183 to 57 with the new template
because the on_supported_os matrix resolves to fewer fact sets. The
OS matrix in metadata.json is still stale and is updated separately.
- Require puppet >= 8.0.0 < 9.0.0
- Declare puppetlabs/stdlib >= 9.0.0 < 11.0.0 in dependencies
- Support RedHat and Rocky 8-10, SLES 12/15, Ubuntu 20.04-24.04
  and Debian 11/12; drop EOL RedHat, CentOS, Debian, Ubuntu
- Simplify .fixtures.yml: unpinned public stdlib, drop the
  redundant module symlink (spec_helper adds it automatically)
- Use an .each loop with the splat operator instead of
  create_resources(sysctl, ...)
- Use lookup('sysctl::base::values', Hash, 'hash', {}) instead of the
  legacy hiera_hash()
- Behaviour is unchanged

Verified: pdk validate clean; pdk test unit: 165 examples,
0 failures, 100% resource coverage.
- Replace templates/sysctl.d-file.erb with a typed EPP template
  and call epp() from the sysctl define
- Output is byte-identical: rendered old ERB and new EPP for 9
  cases (undef/set value, string/array/multi-line/CRLF/empty
  comment); all compared equal with cmp
- Add a spec for a multi-line string comment

Verification: pdk validate clean; pdk test unit 166 examples,
0 failures, 100% resource coverage.
- Generate REFERENCE.md with puppet-strings; regenerated twice with
  no diff, 100.00% documented (0 undocumented)
- Rewrite README in the afs layout with TOC, Setup, Usage, Reference,
  Limitations and Development sections
- Keep the real usage examples, drop the hand-written parameter list
- Remove the stale "Tested on RHEL 6 and 7" claim
- OS list, Puppet and stdlib statements match metadata.json

Ran pdk validate: passed. Ran pdk test unit: 166 examples, 0
failures, 100% resource coverage.
Puppet 7 is no longer supported, so remove its workflow. Bump
actions/checkout from v2 to v5 in the Puppet 8 workflow.
@dsundq
dsundq merged commit 252d751 into Ericsson:master Nov 17, 2026
2 checks passed
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.

1 participant