feat: bake ansible-lint and Mitogen into the image - #47
Conversation
Closes #32: ansible-lint ships in the image with a make lint target that lints everything under playbooks/. Closes #33: mitogen>=0.3.50 (first release supporting ansible-core 2.19) ships disabled by default; enable by uncommenting the two strategy lines in configs/ansible.cfg. Documented caveats for strategy-sensitive setups.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dca8eefa7d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
2 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="Makefile">
<violation number="1" location="Makefile:43">
P2: The lint target runs ansible-lint with cwd /configs, but the PR's README tells users to place .ansible-lint under playbooks/. ansible-lint only searches cwd and parents for its config, so a config dropped in /configs/playbooks/ is silently ignored by `make lint` — custom rules/exclusions won't apply. Reconcile the two: document placing .ansible-lint in configs/ (matching the cd /configs target), or point the target at the playbooks dir / pass -c explicitly.</violation>
</file>
<file name="configs/ansible.cfg">
<violation number="1" location="configs/ansible.cfg:41">
P3: The Mitogen enable step hardcodes a Python-version-specific absolute path (`/usr/local/lib/python3.12/dist-packages/ansible_mitogen/plugins/strategy`) in both `configs/ansible.cfg` and the README's "Faster runs with Mitogen" snippet. The path is valid against the current ubuntu:24.04 base (Python 3.12), but because ansible cannot auto-discover this plugin and the path is duplicated in two files, an upstream base-image/interpreter version change silently breaks the documented enable steps in both places at once. It may be worth deriving the path (or referencing it once) rather than re-typing the version-pinned path in two spots, and noting in the comment that it tracks the base image's Python version.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…path - make lint (and the documented single-file command) now run from /configs/playbooks, where ansible-lint actually searches for .ansible-lint, matching the README instruction. - Symlink Mitogen's strategy directory into Ansible's default plugin search path at build time, so enabling it is a single 'strategy = mitogen_linear' line with no interpreter-version path duplicated across ansible.cfg and README.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c24fddde34
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
All reported issues were addressed across 4 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
- make lint sets XDG_CACHE_HOME=/tmp/.cache so ansible-lint/ ansible-compat caches never write into the read-only playbooks mount, and sets ANSIBLE_CONFIG=/configs/ansible.cfg explicitly since docker exec doesn't inherit the entrypoint's export. - The Mitogen symlink target is now test -d checked so a package layout change fails the build instead of dangling silently.
Closes #32, closes #33
ansible-lint (#32)
make lintlints everything underplaybooks/(runsansible-lintinside the container, so it uses the same ansible-core and collections that execute the playbooks)..ansible-lintconfig placement.Mitogen (#33)
mitogen>=0.3.50— the first release line supporting ansible-core 2.19 (see Support Ansible 12 (ansible-core 2.19) mitogen-hq/mitogen#1258, confirmed by Debian's ansible-mitogen 0.3.50-1 requiring core ≥ 2.19) — is baked in but disabled by default.configs/ansible.cfg(documented in README with the strategy-replacement caveat). Off by default because Mitogen replaces the linear strategy wholesale and not every plugin is compatible.Testing
make lintexercised in CI indirectly via image build (ansible-lint import).Summary by cubic
Bakes
ansible-lintandmitogen>=0.3.50into the controller image. Addsmake lintwith config discovery and an optional Mitogen strategy enabled via a single config line (off by default).ansible-lintinstalled;make lintruns from/configs/playbooksfor.ansible-lintdiscovery, setsANSIBLE_CONFIG=/configs/ansible.cfg, and usesXDG_CACHE_HOME=/tmp/.cacheso caches stay writable. README documents single-file linting.mitogen>=0.3.50installed but disabled; strategy plugin is symlinked into Ansible’s default path and validated at build time. Enable by uncommentingstrategy = mitogen_linearinconfigs/ansible.cfg(note: strategy-sensitive plugins may be incompatible).Written for commit 2024012. Summary will update on new commits.