Skip to content

feat: bake ansible-lint and Mitogen into the image - #47

Merged
allamiro merged 3 commits into
mainfrom
feat/lint-and-mitogen
Aug 10, 2026
Merged

feat: bake ansible-lint and Mitogen into the image#47
allamiro merged 3 commits into
mainfrom
feat/lint-and-mitogen

Conversation

@allamiro

@allamiro allamiro commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Closes #32, closes #33

ansible-lint (#32)

  • Baked into the image via the pip layer; make lint lints everything under playbooks/ (runs ansible-lint inside the container, so it uses the same ansible-core and collections that execute the playbooks).
  • README section documents single-file linting and .ansible-lint config 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.
  • Enable by uncommenting two lines in 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

  • hadolint clean at CI threshold; CI builds both platforms and smoke-tests.
  • make lint exercised in CI indirectly via image build (ansible-lint import).

Summary by cubic

Bakes ansible-lint and mitogen>=0.3.50 into the controller image. Adds make lint with config discovery and an optional Mitogen strategy enabled via a single config line (off by default).

  • New Features
    • ansible-lint installed; make lint runs from /configs/playbooks for .ansible-lint discovery, sets ANSIBLE_CONFIG=/configs/ansible.cfg, and uses XDG_CACHE_HOME=/tmp/.cache so caches stay writable. README documents single-file linting.
    • mitogen>=0.3.50 installed but disabled; strategy plugin is symlinked into Ansible’s default path and validated at build time. Enable by uncommenting strategy = mitogen_linear in configs/ansible.cfg (note: strategy-sensitive plugins may be incompatible).

Written for commit 2024012. Summary will update on new commits.

Review in cubic

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.
@allamiro allamiro added the enhancement New feature or request label Aug 10, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread README.md Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread Makefile
Comment thread configs/ansible.cfg Outdated
…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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread Makefile Outdated
Comment thread Makefile Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread Makefile Outdated
Comment thread Makefile Outdated
Comment thread docker/Dockerfile Outdated
- 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.
@allamiro
allamiro merged commit 53803cf into main Aug 10, 2026
6 checks passed
@allamiro
allamiro deleted the feat/lint-and-mitogen branch August 10, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add Mitogen strategy plugin for faster playbook execution feat: add ansible-lint to image and make lint Makefile target

1 participant