Skip to content

Make the control repo branch configurable - #209

Merged
silug merged 3 commits into
puppet-bootstrap:productionfrom
silug:control-branch
Nov 4, 2026
Merged

silug merged 3 commits into
puppet-bootstrap:productionfrom
silug:control-branch

Conversation

@silug

@silug silug commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Adds a control_branch parameter to the basic_aio plan, defaulting to production, and a matching CONTROL_BRANCH variable to the Vagrantfile. This lets an environment run a branch other than production, such as a PR branch in CI. That's the next step, in a separate PR.

With control_repo, the plan:

  • Still deploys every branch with r10k, as before. It then fails if the chosen branch's environment wasn't deployed, before touching any agent.
  • Runs puppet config set environment <branch> --section agent on every target before the first agent run, so both the first runs and the puppet service use that environment.

The branch has to be a valid environment name, meaning letters, digits, and underscores. Both the plan parameter and the Vagrantfile check this. r10k would otherwise skip a branch like my-feature or deploy it under a different name. The README notes that the control repo still needs a production branch, because the server fails to process reports without that environment. #210's CI turned this up. basic_aio::preflight accepts the parameter so command lines still work with only the plan name changed.

Testing

  • CONTROL_BRANCH=ci_test vagrant up on a clone with a local ci_test branch built production and ci_test environments. Both puppet and agent have environment = ci_test and report Using environment 'ci_test', and a second agent run on each exited 0.
  • CONTROL_BRANCH=no_such_branch vagrant provision failed with "The control repo has no no_such_branch branch" before changing the agents.
  • puppet-lint passes on the Bolt plans, and bolt plan show parses both plans.

🤖 Generated with Claude Code

Add a `control_branch` parameter to the `basic_aio` plan (defaulting to
`production`) and a matching `CONTROL_BRANCH` variable to the
Vagrantfile.  With `control_repo`, the plan checks that r10k deployed
the branch's environment and sets `environment` in every target's
`[agent]` section of puppet.conf before the first agent runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
silug and others added 2 commits November 4, 2026 19:07
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silug
silug merged commit 012b20d into puppet-bootstrap:production Nov 4, 2026
15 checks passed
@silug
silug deleted the control-branch branch November 4, 2026 20:13
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