initial implementation: encapi ENC server + CLI #1

Merged
benvin merged 1 commits from benvin/initial-implementation into main 2026-07-05 00:10:17 +10:00
Owner

Why

encapi replaces Cobbler as Puppet's External Node Classifier. Cobbler currently answers Puppet's exec node_terminus (/opt/cobbler-enc/cobbler-enc) and the per-node enc_direct_facts.rb fact. This is the initial implementation of the Postgres-backed Go replacement, keeping Puppet's classification contract byte-compatible.

Changes

  • add encapi HTTP server (chi + pgx): read/write API plus two ENC document shapes — the reshaped form for the exec terminus (list classes, environment dropped when testing, enc_role/enc_env params) and the cobbler-wire form so enc_direct_facts.rb repoints by URL only
  • add encapi-cli: classify (the Puppet ENC), node/role/status CRUD, and an import-cobbler seeder (HTTP-only, via PuppetDB + Cobbler)
  • add pkg/client Go SDK and a pluggable distro-resolver seam (off by default)
  • add unit tests across every package (DB tests via testcontainers)
  • add Dockerfile (distroless), Makefile, nfpm RPM (ships encapi-cli + the encapi-enc wrapper), Woodpecker CI, and docs/cutover.md

Data model: statuses (environments), roles (with inheritable default_params), nodes (host->role+env+params), with FK integrity. Live-validated against real Cobbler: import seeded 143 nodes / 51 roles, and classify output matches Cobbler exactly.

## Why encapi replaces Cobbler as Puppet's External Node Classifier. Cobbler currently answers Puppet's `exec` node_terminus (`/opt/cobbler-enc/cobbler-enc`) and the per-node `enc_direct_facts.rb` fact. This is the initial implementation of the Postgres-backed Go replacement, keeping Puppet's classification contract byte-compatible. ## Changes - add encapi HTTP server (chi + pgx): read/write API plus two ENC document shapes — the reshaped form for the `exec` terminus (list classes, `environment` dropped when `testing`, `enc_role`/`enc_env` params) and the cobbler-wire form so `enc_direct_facts.rb` repoints by URL only - add `encapi-cli`: `classify` (the Puppet ENC), node/role/status CRUD, and an `import-cobbler` seeder (HTTP-only, via PuppetDB + Cobbler) - add `pkg/client` Go SDK and a pluggable distro-resolver seam (off by default) - add unit tests across every package (DB tests via testcontainers) - add Dockerfile (distroless), Makefile, nfpm RPM (ships `encapi-cli` + the `encapi-enc` wrapper), Woodpecker CI, and `docs/cutover.md` Data model: statuses (environments), roles (with inheritable `default_params`), nodes (host->role+env+params), with FK integrity. Live-validated against real Cobbler: import seeded 143 nodes / 51 roles, and `classify` output matches Cobbler exactly.
unkinben added 1 commit 2026-07-04 23:45:50 +10:00
Postgres-backed External Node Classifier for Puppet, replacing Cobbler.
- encapi HTTP server (chi + pgx): read/write API + two ENC document shapes
  (reshaped for the exec terminus; cobbler-wire for enc_direct_facts.rb)
- encapi-cli: classify/node/role/status CRUD + import-cobbler seeder
- pkg/client Go SDK; unit tests across all packages (DB via testcontainers)
- Dockerfile (distroless), Makefile, nfpm RPM (encapi-cli + encapi-enc wrapper),
  Woodpecker CI, docs/cutover.md
benvin merged commit 02ef30ee17 into main 2026-07-05 00:10:17 +10:00
Sign in to join this conversation.