No description
  • Python 49.2%
  • Shell 34.9%
  • Jinja 8.7%
  • Dockerfile 7.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
oliver.maklott 824f06954a
All checks were successful
release / release (push) Successful in 49s
ci / probe (push) Successful in 0s
ci / test (push) Successful in 59s
toolchain v0.6.4: the address scan sees a sentence's end
An IPv4 address followed by a full stop was not found; without a
denylist the scan now says so on a workstation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PVUe4g65L7UnUVqHmQp7kG
2026-11-30 05:30:20 +00:00
.forgejo/workflows Initial toolchain: pinned setup, bt-ci, leak checks, collection template 2026-11-22 19:40:35 +00:00
bin toolchain v0.6.3: molecule/setup.sh hook 2026-11-29 00:29:08 +00:00
config toolchain v0.5.1: gitleaks ignores checksums in the hcloud token rule 2026-11-26 21:41:04 +00:00
docs toolchain v0.2.0: Molecule scenarios without VMs 2026-11-22 20:18:37 +00:00
ee toolchain v0.4.3: retry Galaxy in the lab image, show build failures 2026-11-26 15:46:54 +00:00
requirements toolchain v0.6.1: python-dateutil for hetzner.hcloud 2026-11-28 16:36:55 +00:00
src/belowtoxic_toolchain toolchain v0.6.4: the address scan sees a sentence's end 2026-11-30 05:30:20 +00:00
template toolchain v0.5.1: gitleaks ignores checksums in the hcloud token rule 2026-11-26 21:41:04 +00:00
tests toolchain v0.6.4: the address scan sees a sentence's end 2026-11-30 05:30:20 +00:00
.dockerignore Initial toolchain: pinned setup, bt-ci, leak checks, collection template 2026-11-22 19:40:35 +00:00
.gitignore Initial toolchain: pinned setup, bt-ci, leak checks, collection template 2026-11-22 19:40:35 +00:00
.pre-commit-config.yaml Initial toolchain: pinned setup, bt-ci, leak checks, collection template 2026-11-22 19:40:35 +00:00
.pre-commit-hooks.yaml Initial toolchain: pinned setup, bt-ci, leak checks, collection template 2026-11-22 19:40:35 +00:00
CHANGELOG.md toolchain v0.6.4: the address scan sees a sentence's end 2026-11-30 05:30:20 +00:00
CONTRIBUTING.md Initial toolchain: pinned setup, bt-ci, leak checks, collection template 2026-11-22 19:40:35 +00:00
copier.yml toolchain v0.6.4: the address scan sees a sentence's end 2026-11-30 05:30:20 +00:00
LICENSE Initial toolchain: pinned setup, bt-ci, leak checks, collection template 2026-11-22 19:40:35 +00:00
pyproject.toml Initial toolchain: pinned setup, bt-ci, leak checks, collection template 2026-11-22 19:40:35 +00:00
README.md toolchain v0.6.0: restic 2026-11-27 19:51:39 +00:00
SECURITY.md Initial toolchain: pinned setup, bt-ci, leak checks, collection template 2026-11-22 19:40:35 +00:00
tools.env toolchain v0.6.2: restic 0.20.0 2026-11-28 20:00:34 +00:00

toolchain

Shared tooling for every repository of the belowtoxic-ansible organisation: one pinned toolchain for developers and CI, the leak checks that keep infrastructure data out of these public repositories, shared lint configuration, and the template every collection is generated from.

Path What
bin/bt-ci-setup Builds the pinned toolchain on any Linux x86_64 host (developer laptop or CI runner)
bin/bt-ci CI entry point: checkout, lint, sanity, units, molecule, build, release, leak-scan
requirements/dev.in → dev.txt Python toolchain, locked with hashes (uv pip compile)
tools.env Pinned external binaries (uv, butane, ignition-validate, bao, gitleaks, restic, hcloud-upload-image) with SHA-256
ee/ Optional container image with the same content (ee/Containerfile)
config/ Shared ansible-lint, yamllint and gitleaks configuration
src/belowtoxic_toolchain/public_ips.py check-public-ips: rejects public IP literals and denylisted strings
copier.yml, template/ Collection template (copier copy / copier update)
docs/ Conventions, leak prevention, runners

Quick start

git clone https://git.belowtoxic.cloud/belowtoxic-ansible/toolchain.git
eval "$(toolchain/bin/bt-ci-setup)"

bt-ci-setup creates a content-addressed environment under ~/.cache/bt-ci/<hash> (override with BT_CI_HOME): a uv-managed Python, the hash-locked Python packages (ansible-core, hvac, molecule, linters), checksum-verified binaries (bao, butane, gitleaks, ...) and the upstream collections from ee/requirements.yml. The first run takes about a minute; later runs only print the environment. CI runs exactly the same script.

It changes nothing in your shell by itself: it prints export lines, and eval runs them. Run it plainly and it says so. Then check:

bt-ci doctor     # in a repository: toolchain version, tools on PATH, hvac, collections, OpenBao login

To update: git pull in the toolchain checkout, then the same eval again (a changed toolchain builds a new environment). bt-ci version shows which one is active.

Virtualenvs and pyenv

The toolchain is a virtualenv - with a pinned Python and hash-checked packages, identical to CI. You do not need another one, and the toolchain does not install into yours. After the eval, its bin/ directories come first in PATH, so an activated venv is shadowed (not used) until you deactivate it or open a new shell.

Two setups put another environment back in front of the toolchain and make ansible-playbook run on a Python without the pinned packages (symptom: Failed to import the required Python library (hvac) naming another Python):

  • activating a venv after the eval - run the eval again, or don't activate the venv;
  • pyenv-virtualenv's automatic activation (.python-version naming a virtualenv): its prompt hook re-activates it at every prompt - remove that .python-version in these repositories, or pyenv deactivate.

bt-ci doctor names the culprit. If you really want to work in your own venv: pip install --require-hashes -r toolchain/requirements/dev.txt, ansible-galaxy collection install -r toolchain/ee/requirements.yml, and install the binaries from tools.env yourself - CI will not test that combination.

Collections

The toolchain's upstream collections live in its venv's site-packages, which Ansible always searches last. Repositories install their own pins to ./collections (ansible.cfg: collections_path = ./collections), and those win. Leave ANSIBLE_COLLECTIONS_PATH unset: it overrides ansible.cfg and hides ./collections (toolchain v0.3.x set it; the eval of v0.4.0 unsets that old value).

New collection

copier copy --trust https://git.belowtoxic.cloud/belowtoxic-ansible/toolchain.git collection-foo
cd collection-foo && git init && pre-commit install

Pull later template changes (lint config, workflows, hooks) into an existing collection with copier update --trust.

Updating pins

  • Python: edit requirements/dev.in, then uv pip compile --universal --python-version 3.12 --generate-hashes -o requirements/dev.txt requirements/dev.in.
  • Binaries: change version and checksum in tools.env and the matching ARGs in ee/Containerfile. Verify upstream signatures where they exist (butane is signed with the Fedora key, OpenBao, gitleaks and hcloud-upload-image publish checksum files). hcloud-upload-image is workstation-only and has no ARG in the Containerfile.
  • Collections: ee/requirements.yml.

Release a new toolchain version (tag vX.Y.Z) and bump toolchain_ref in the collections via copier update.

Tests

pytest -q && ruff check src tests && mypy --strict src

License

MIT, see LICENSE. The collection template ships GPL-3.0-or-later, as Ansible plugins link against ansible-core.