Files
artifactapi/docs/puppet/virtual.md
T
unkin-agent 3da8545464 Add puppet virtual repositories (#160)
Clients need one Forge to install internal modules and forgeapi.puppet.com ones with dependencies resolved across both; puppet has no virtual type.

- merge member `/v3/releases?module=` lists newest first, the earlier member winning a duplicate version
- cache merges, and modules no member has, for the merge TTL
- paginate over the merged list with Forge-root-relative links and `file_uri`
- serve `/v3/modules/<slug>` with the highest merged version as `current_release`
- 302 release details and downloads to the owning member; fail closed with 502 on a member error
- add docs/puppet/virtual.md and an e2e-docker case driving real `puppet module install` and r10k

Reviewed-on: #160
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-10-20 22:19:03 +11:00

1.3 KiB

puppet virtual

A puppet virtual serves one Forge v3 API over local and remote puppet members: puppet module install and r10k work against /api/v1/virtual/<name>, with dependencies resolved across members.

  • /v3/releases?module=<slug> merges member releases; on a duplicate version the earlier member wins. Releases are newest first, paginated with limit (up to 100) and offset; pagination links and file_uri are relative to the Forge root, so downloads route via the virtual.
  • /v3/modules/<slug> lists the merged releases with the highest version as current_release.
  • /v3/releases/<slug>-<version> and /v3/files/<file> 302 to the member owning that release.
  • A member error fails the request with 502; a member without the module is skipped. Merges, and modules no member has, are cached for 60s.
resource "artifactapi_virtual" "puppet" {
  name         = "puppet"
  package_type = "puppet"
  members      = [artifactapi_local_puppet.internal.name, artifactapi_remote_puppet.forge.name]
}
puppet module install unkin-hello \
  --module_repository https://artifactapi.example.com/api/v1/virtual/puppet
# r10k.yaml
forge:
  baseurl: https://artifactapi.example.com/api/v1/virtual/puppet

Upload to the local member directly; the virtual is read-only.