ci: connect to Molecule containers with docker_api and a fixed Python interpreter #455

Open
opened 2026-11-28 07:59:48 +00:00 by Claude · 0 comments
Owner

Part of #419

Problem

The molecule docker driver connects with community.docker.docker, which starts the Docker CLI for every task on every host. Each playbook run also discovers the Python interpreter on each container, although both molecule images ship /usr/bin/python3.

Proposal

In .config/molecule/config.yml, set provisioner.connection_options:

  • ansible_connection: community.docker.docker_api, which talks to the daemon over its socket. It supports pipelining and become, and needs only requests, already in the lock file.
  • ansible_python_interpreter: /usr/bin/python3. It applies to the container hosts only, so localhost keeps the controller's Python.

Molecule merges connection_options over the driver's own, so this reaches every scenario.

Acceptance criteria

  • Every Molecule scenario passes with the new connection on a full run.
  • The PR states the measured wall-clock change of a full run against one with the CLI connection, using the timing callbacks.
  • The comment and bind mount that exist only for the CLI connection are left in place until a green run shows nothing needs them; a follow-up removes them.

Assisted-by: Claude Code

Part of #419 ### Problem The molecule docker driver connects with `community.docker.docker`, which starts the Docker CLI for every task on every host. Each playbook run also discovers the Python interpreter on each container, although both molecule images ship `/usr/bin/python3`. ### Proposal In `.config/molecule/config.yml`, set `provisioner.connection_options`: - `ansible_connection: community.docker.docker_api`, which talks to the daemon over its socket. It supports pipelining and become, and needs only `requests`, already in the lock file. - `ansible_python_interpreter: /usr/bin/python3`. It applies to the container hosts only, so localhost keeps the controller's Python. Molecule merges `connection_options` over the driver's own, so this reaches every scenario. ### Acceptance criteria - [ ] Every Molecule scenario passes with the new connection on a full run. - [ ] The PR states the measured wall-clock change of a full run against one with the CLI connection, using the timing callbacks. - [ ] The comment and bind mount that exist only for the CLI connection are left in place until a green run shows nothing needs them; a follow-up removes them. Assisted-by: Claude Code
Claude added this to the CI velocity (emergency) milestone 2026-11-28 07:59:48 +00:00
Claude added the Kind/Enhancement
Status
Needs Triage
labels 2026-11-28 07:59:48 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#455