$ show ansible/ansible-dev-tools
Ansible Development Tools (ADT) is an installable Python package and CLI wrapper that bundles the official Ansible content-creation toolchainβansible-builder, ansible-core, ansible-creator, ansible-dev-environment, ansible-lint, ansible-navigator, ansible-sign, molecule, pytest-ansible, and tox-ansibleβbehind a single `adt` command. The package's own Python code is deliberately small: `adt --version` enumerates versions of the bundled tools via importlib.metadata, and `adt server` starts an embedded Django WSGI application served by Gunicorn. The repository also contains build definitions for the `community-ansible-dev-tools` execution environment and an OpenShift Dev Spaces image, including podman-in-container support. The production behavior of the original code is a machine-facing REST API, not a user interface. Endpoints under `/v1/creator` and `/v2/creator` invoke ansible-creator's Python API to scaffold playbook, collection, devfile, and execution-environment projects and return them as tar archives. The server additionally exposes `/metadata`, `/v2/creator/capabilities`, `/v2/creator/schema`, and `/v2/creator/scaffold` for backend discovery and dynamic command execution. Every request and response is validated against a bundled OpenAPI 3.1 schema using openapi-core, with validation failures returned as HTTP 400 responses. Outside the Python package, the repo contains substantial container engineering: multi-architecture image builds with buildx, GHCR manifest publishing, rootless podman setup, and an entrypoint that dynamically allocates subuid/subgid ranges for OpenShift's random-UID model. CI is comprehensive, with tox-based linting, unit/integration/container tests, CodeQL, nightly devel image builds, and automated dependency updates. Minor blemishes existβduplication between the v1/v2 creator handlers, a deprecated `MIDDLEWARE_CLASSES` Django setting, and docs that still mention Python 3.10 while the package requires 3.11+βbut the codebase is current, well-tested, and actively maintained.
The LLM identified 4 files worth highlighting for reuse:
Wraps openapi-core's Django integration to validate incoming requests and outgoing responses against a schema loaded from package data. It is isolated from business logic and can be dropped into any Django service that needs schema-driven request/response enforcement.
Demonstrates bootstrapping a Django WSGI application programmatically without a settings module and serving it through a custom gunicorn.BaseApplication subclass. The AdtServerApp class is a small, reusable pattern for packaging an API server inside a CLI tool.
Uses importlib.metadata to format a sorted, aligned version table for a list of installed distributions, gracefully reporting missing packages. Self-contained and directly reusable in any CLI that needs unified version output across multiple dependencies.
A production-grade container entrypoint that derives available subordinate UID/GID ranges from /proc/self/uid_map, writes /etc/subuid and /etc/subgid for the current user, ensures NOPASSWD sudo, and execs catatonit. It solves the hard OpenShift random-UID/rootless-podman problem in a reusable way.