Skip to content

Add puppetfile option to bolt-project.yaml#263

Draft
op-ct wants to merge 8 commits into
OpenVoxProject:mainfrom
op-ct:feature/declare-alt-project-puppetfile-in-bolt-project-yaml
Draft

Add puppetfile option to bolt-project.yaml#263
op-ct wants to merge 8 commits into
OpenVoxProject:mainfrom
op-ct:feature/declare-alt-project-puppetfile-in-bolt-project-yaml

Conversation

@op-ct

@op-ct op-ct commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

This patch adds support and tests for a puppetfile option in bolt-project.yaml to specify an alternate Puppetfile name/location from the (presently unchangeable) <project dir>/Puppetfile generated by bolt module install and edited by bolt module add. This will enable openbolt projects in control repositories to define their requirements separately from the Puppet-managed infrastructure.

Assisted-by: Claude Opus 4.7, on a tight leash
Fixes #262

Checklist

I have:

  • read the CONTRIBUTING.md document
  • read and accepted the Developer Certificate of Origin document and added a Signed-off-by annotation to each of my commits
  • read and accepted the AI Policy document and added Generated-by or Assisted-by annotations to each of my commits created with the help of an AI agent
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code -- (N/A: actual code is basically two lines and an if)
  • added or modified regression integration test(s)
  • added or modified unit test(s)

op-ct added 5 commits June 30, 2026 20:31
Signed-off-by: Chris Tessmer <chris.tessmer@onyxpoint.com>
Signed-off-by: Chris Tessmer <chris.tessmer@onyxpoint.com>
Assisted-by: Claude Opus 4.7
Signed-off-by: Chris Tessmer <chris.tessmer@onyxpoint.com>
Assisted-by: Claude Opus 4.7
Signed-off-by: Chris Tessmer <chris.tessmer@onyxpoint.com>
Assisted-by: Claude Opus 4.7
Signed-off-by: Chris Tessmer <chris.tessmer@onyxpoint.com>
@op-ct op-ct marked this pull request as draft June 30, 2026 22:27
op-ct added 2 commits June 30, 2026 22:30
Assisted-by: Claude Opus 4.7
Signed-off-by: Chris Tessmer <chris.tessmer@onyxpoint.com>
The spec tests fails when run ion Windows hosts, because the Windows
Ruby `File.expand_path()` prepends the drive letter.  The spec test
now does expands both sides so the comparison is sound regardless of
OS.

Assisted-by: Claude Opus 4.7
Signed-off-by: Chris Tessmer <chris.tessmer@onyxpoint.com>
# modules.
#
def write(path, moduledir = nil)
FileUtils.mkdir_p(File.dirname(path))

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.

Shall we limit this to be a subdir of the current dir only maybe? I'm not sure if it's good idea to allow specifying literally any file path as a Puppetfile.

E.g. if Bob creates a repo with puppetfile set to /etc/shadow and then give that to Alice. Alice runs bolt module install and got their workstation broken.

I'm not sure what is our strategy here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch (and may god have mercy on Alice if she installs modules with sudo and --force).
I was thinking about subdirs within the project directory, so I'll restrict it to that

@op-ct

op-ct commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Temporarily set to "draft" while working through GHA test failures (related: #264)

Throw a validation error if a bolt-project.yaml 'puppetfile' option
isn't a relative path that resolves to inside the poroject directory.

Assisted-by: Claude Opus 4.7
Signed-off-by: Chris Tessmer <chris.tessmer@onyxpoint.com>
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.

Specify alternate puppetfile in bolt-project.yaml

2 participants