fix: address the review findings on the per-task overhead change

- Require ansible-core 2.21: the deploy CLI refuses a venv whose packages
  differ from the exact pins of the deploy extra, the carrier action names
  the version it needs instead of failing on an import, and the image
  installs the pinned ansible from pyproject.toml.
- Lint: catch compact == comparisons, scan compose/, inventories/ and both
  playbooks, flag bare services/packages/getent_* reads, and derive the
  allowlist from ansible-core's variable map and the plugins' documented
  options.
- Tag the play environment freeze and check with always, and cover a task
  override, a handler, a delegated task and a tagged run.
- Map a failed docker.service query to its fail_msg.
- Pin the docker_cached options to the installed stock connection, read
  the carrier through hostvars in a two-host test, and correct the carrier
  guard message and the stale README line reference.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alejandro RomanandClaude Opus 5.5 committed 2026-11-20 03:01:19 +04:00
1 parent 066a84d0a6
commit 5da3579d3e
14 files changed
+365 -76

No files matched your search

@@ -1,5 +1,6 @@
from __future__ import annotations
import importlib.metadata
import io
import json
import subprocess
@@ -365,6 +366,25 @@ class TestDeployAnsiblePlaybook(unittest.TestCase):
self.assertIn(absent, stderr.getvalue())
self.assertNotIn("PyYAML", stderr.getvalue())
def test_exits_naming_a_deploy_pin_the_interpreter_carries_at_another_version(
self,
):
installed = importlib.metadata.version("PyYAML")
pinned = f"PyYAML=={installed}.post999"
repo_root, bindir = self._checkout(
[pinned, f"ruamel.yaml=={importlib.metadata.version('ruamel.yaml')}"],
with_playbook=True,
)
stderr = io.StringIO()
with (
unittest.mock.patch.object(runner.sys, "stderr", stderr),
self.assertRaises(SystemExit) as ctx,
):
self._resolve(repo_root, bindir)
self.assertEqual(ctx.exception.code, 1)
self.assertIn(f"{pinned} (installed: {installed})", stderr.getvalue())
self.assertNotIn("ruamel.yaml", stderr.getvalue())
def test_exits_when_no_ansible_playbook_sits_beside_the_interpreter(self):
repo_root, bindir = self._checkout(["PyYAML"], with_playbook=False)
with (