Add pburl and pblastreport companion tools to the RPM #15
Reference in New Issue
Block a user
Delete Branch "benvin/pburl-pblastreport"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
node-lookupoutput is handy for pivoting to Puppetboard, but there was no quick way to turn a list of hosts into Puppetboard node-page URLs, or to see when each host last ran Puppet. These two small tools close that gap and ship in the same RPM so they're available wherevernode-lookupis.Changes
pburl: reads hostnames from args or pipednode-lookupoutput (first field of each line, de-duped) and prints<host> <puppetboard-node-page-url>.pblastreport: prints<host>\t<last-report-time>\t<url>usingreport_timestampfrom the PuppetDB v4nodesendpoint. Supports--relative/-r(relative age) and--timezone/-z <IANA>(default: local timezone).internal/puppetpackage shared by both tools: config load, PuppetDBnodesquery, Puppetboard URL construction (<base>/node/<certname>), and no-TTY-safe stdin host reading.puppetboard_urlconfig key (envNODE_LOOKUP_PUPPETBOARD_URL, defaulthttps://puppetboard.k8s.syd1.au.unkin.net) to the shared config soconfig init/config showscaffold it for the whole tool family.node-lookup's own query behaviour is unchanged.mainpackage — a singlego build ./...can't emit multiple mains) and generate per-binary bash/zsh/fish completions in the Makefile,build-rpm.sh, and nfpm spec..gitignore;go mod tidypromotes cobra/yaml to direct deps.AGENTS.md.Testing
go test -race ./...passes (new tests cover config precedence,nodesendpoint derivation, host-page URLs,LookupNode, stdin host parsing, and the report-time formatting incl. timezone/relative/edge cases).No cross-repo changes needed: the release reuses the existing
defaultServiceAccount and the artifactapirpm-internalupload.