Distribute code to the compiler with codavox - #64
Merged
Conversation
The compiler has had no way to get resolved Puppet code. OpenVox Server ships without Code Manager and file sync, so nothing puts a versioned tree on a compiler or lets it answer which version it is serving. This wires codavox in: the publisher on the primary where the code already lives, the agent on the compiler. Adoption is staged, because codavox has no fallback by design. Once OpenVox Server is pointed at it, catalog compilation depends on the agent having deployed code there, so a compiler wired before its agent converges fails every compile — loudly, which is correct, but it fails. So profile::codavox::agent::wire_server defaults to false: the agent converges this node and keeps it current, without touching how catalogs are compiled. Flipping it later is a restart rather than a wait. Settings live in Hiera under codavox::* rather than as profile parameters, so a node that ends up running both the publisher and an agent still resolves one consistent codavox class instead of declaring it twice with different data. The publisher's staging directory is r10k's basedir, which here is the codedir the control repo is already synced into. codavox needs no staging area of its own, and pointing it one level higher gives a publisher that starts cleanly and advertises nothing. The compiler is authorized by the pp_role in its certificate, which csr_attributes.yaml writes before enrolment. That works because the compiler VM was built that way; an estate whose compiler certificates predate codavox would use codavox::publish_allow_certnames instead, since pp_role cannot be added to an already-issued certificate. puppet-codavox is pinned by tag rather than floating on a branch. codavox exists to make code versions deterministic, and resolving its own module non-deterministically would undercut the point. Also adds puppetlabs/yumrepo_core to the Puppetfile. yumrepo left Puppet core, and while site-modules/profile/.fixtures.yml already declared it for the module's own specs, the control repo never shipped it — so onceover failed to compile every RedHat role with "Unknown resource type: 'yumrepo'". Real nodes were unaffected because openvox-agent bundles it, which is why this went unnoticed. Fixing it is what makes onceover able to verify any of the above.
codavox 0.5.0 renamed the staging setting to basedir with no alias, so the Hiera key becomes codavox::basedir and the module pin moves to puppet-codavox v0.2.0, which emits the new key. Leaving either behind would produce a publisher that refuses to start, since codavox rejects unknown config keys rather than ignoring them. The rename is worth having: nothing is staged. The publisher only reads that directory and writes nothing to it — the comment on this node's setting now says so, because the old name implied codavox kept a copy somewhere and it does not. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
miharp
added a commit
that referenced
this pull request
Jul 26, 2026
) Reverts #63, #64, and #65: the compiler VM, the pp_role csr_attributes, and all the codavox wiring. The tree is now identical to 0a7c5f8 apart from one Puppetfile line. This repo is a dev environment — an edit to production has to appear on the next agent run with no deploy step. codavox distributes sealed, immutable, content-addressed versions. The two models are structurally opposed, and everything added to reconcile them was paying for the mismatch: a directory of environments nested inside an environment so the publisher had something other than the working tree to seal; a working tree that cannot be sealed at all, because .onceover/ holds rspec-puppet fixture symlinks pointing at absolute macOS host paths; a compiler that could never serve production, since codavox replaces environmentpath rather than adding to it; and static catalogs turned off on the primary, a real capability lost purely to the conflict. The compiler VM goes too. Without codavox it had no code — no synced mount, and a stock empty production skeleton — so it installed openvox-server on a node that could only compile empty catalogs. codavox was the only thing that ever fed it. codavox validation moves to a control repo built for it, where r10k deploys a clean tree and static catalogs stay on. puppetlabs/yumrepo_core is kept because it is the one fix here that had nothing to do with codavox. yumrepo left Puppet core, and while site-modules/profile/.fixtures.yml already declared it for the module's own specs, the control repo never shipped it — so onceover could not compile any RedHat role, failing with "Unknown resource type: 'yumrepo'". Real nodes were unaffected because openvox-agent bundles it, which is why it went unnoticed. Verified: onceover passes all four remaining roles, and the profile suite is back to 96 examples with no failures. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.
The compiler has had no way to get resolved Puppet code. OpenVox Server ships without PE's Code Manager and file sync, so nothing puts a versioned tree on a compiler or lets it answer which version it is serving. This wires codavox in — publisher on the primary where the code already lives, agent on the compiler.
Staged on purpose
profile::codavox::agent::wire_serverdefaults to false.codavox has no fallback by design: once OpenVox Server is pointed at it, catalog compilation depends on the agent having deployed code there. A compiler wired before its agent converges fails every catalog compile — loudly, which is correct, but it fails.
So stage 1 is what this PR does: the agent converges the compiler and keeps it current, without touching how catalogs are compiled. Confirm with
codavox code-id productionon the compiler andcodavox compilerson the primary, then flipwire_serverto true — a restart, not a wait.Shape
puppet.example.comrole::puppet_masterprofile::codavox::publisher— seals the codedir, serves on 8150compiler.example.comrole::compilerprofile::codavox::agent— polls, verifies, swapsSettings live in Hiera under
codavox::*rather than as profile parameters, so a node that ends up running both the publisher and an agent still resolves one consistentcodavoxclass instead of declaring it twice with conflicting data.stagingis r10k'sbasedir— here the codedir the control repo is already synced into. codavox needs no staging area of its own, and pointing it one level higher gives a publisher that starts cleanly and advertises nothing.The compiler is authorized by the
pp_rolein its certificate, written intocsr_attributes.yamlbefore enrolment (#63). An estate whose compiler certificates predate codavox would usecodavox::publish_allow_certnamesinstead, sincepp_rolecannot be added to an already-issued certificate.puppet-codavoxis pinned tov0.1.0rather than floating on a branch: codavox exists to make code versions deterministic, and resolving its own module non-deterministically would undercut the point.Drive-by fix: onceover was broken for every RedHat role
Adding
puppetlabs/yumrepo_coreto the Puppetfile.yumrepoleft Puppet core, and whilesite-modules/profile/.fixtures.ymlalready declared it for the module's own specs, the control repo never shipped it — so onceover failed to compilerole::puppet_master,role::compiler,role::database_server, androle::webserverwithUnknown resource type: 'yumrepo'.Real nodes were unaffected because openvox-agent bundles it, which is why this went unnoticed. I confirmed it was pre-existing by stashing this branch and reproducing the identical four failures on a clean tree. Fixing it is what makes onceover able to verify any of the above.
Two things I did not change, worth a look
The primary still compiles static catalogs with
profile::static_catalogs, whose hand-rolledcode_id.shends in:On this primary it doesn't reach the timestamp — production is the synced control repo, so
.gitexists and it returnsgit rev-parse HEAD. But HEAD describes the control repo, not resolved module content, and does not change when the host working tree does. It also writes to stderr while exiting 0, which OpenVox Server logs at ERROR on every compile.The practical consequence: a catalog compiled by the primary and one compiled by the compiler now carry
code_ids from two different schemes, which are not comparable. Moving the primary onto codavox too (an agent polling its own publisher) is the natural stage 3.The eyaml private key travels in the artifact.
keys/private_key.pkcs7.pemlives in the synced production directory, so the publisher seals it and ships it to compilers. A compiler needs it to decrypt hiera-eyaml data during compilation, so this is functionally required — but it is worth knowing that the key is in the distributed tree rather than provisioned separately.Verification
role::puppet_masterandrole::compilerwith codavox wired. Confirmedcodavoxis fetched at the pinned tag (miharp-codavox 0.1.0).118 examples, 0 failures(96 existing + 22 new across both OSes), coveringwire_serveroff and on, the firewall rule at default and custom ports, and thatcodavox::serveris absent by default.rake validate lint checkclean;puppet parser validateand cspell clean on all new files.Not yet run on the Vagrant VMs — happy to
vagrant destroy && upto prove a clean install if you want that before merging.