From c0681e4bc2d55df19056f3d3a7b997f9e7335890 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sat, 22 Aug 2026 08:12:34 +0300 Subject: [PATCH] Upgrade Ansible Docker image (14.0.0-r0-2 -> 14.0.0-r0-3) and update SSH prompt docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous image versions set ANSIBLE_WORKER_SESSION_ISOLATION=False in an attempt to restore SSH prompts on Ansible 2.21. That setting does not bring the prompts back — it makes Ansible hang silently at the first SSH connection whenever a prompt would have been needed. See https://github.com/devture/docker-ansible/issues/6 The new image auto-accepts the SSH host keys of previously unknown hosts instead. The docs stop recommending ANSIBLE_WORKER_SESSION_ISOLATION=False for direct (non-Docker) runs for the same reason, and now explain how to use an ssh-agent for passphrase-protected SSH keys. Co-Authored-By: Claude Fable 5 --- .devcontainer/Dockerfile | 2 +- docs/ansible.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1ea117868..efca66f04 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: AGPL-3.0-or-later -FROM ghcr.io/devture/ansible:14.0.0-r0-2 +FROM ghcr.io/devture/ansible:14.0.0-r0-3 # Install additional packages RUN apk add --no-cache \ diff --git a/docs/ansible.md b/docs/ansible.md index 1a4cbc1e8..7c5417ba6 100644 --- a/docs/ansible.md +++ b/docs/ansible.md @@ -45,11 +45,11 @@ If Ansible fails with `Host key verification failed` (or a similar `Data could n Since Ansible 2.21, forked workers call `setsid()` and thus lose the controlling terminal. SSH cannot open `/dev/tty` anymore, so it can no longer ask you to confirm an unknown host key or prompt you for the passphrase of an SSH key. -The simplest fix is to connect to the server once (e.g. `ssh root@matrix.example.com`) and confirm the host key. Ansible runs after that will find it in your `known_hosts` file. +To fix host key errors, connect to the server once (e.g. `ssh root@matrix.example.com`) and confirm the host key. Ansible runs after that will find it in your `known_hosts` file. -Alternatively, run Ansible with the `ANSIBLE_WORKER_SESSION_ISOLATION=False` environment variable to get these prompts back (e.g. `ANSIBLE_WORKER_SESSION_ISOLATION=False just install-all`). +If your SSH key is protected by a passphrase, load it into an [ssh-agent](https://man.openbsd.org/ssh-agent) (e.g. `ssh-add ~/.ssh/id_ed25519`), so that SSH does not need to prompt for the passphrase. -**Note**: this does not affect you if you're [using Ansible via Docker](#using-ansible-via-docker), because our Docker image already disables session isolation for you. +**Note**: if you're [using Ansible via Docker](#using-ansible-via-docker), host keys of previously unknown hosts are accepted automatically, so only the passphrase advice above applies to you. For the agent to be reachable inside the container, share its socket by adding `--mount type=bind,src=$SSH_AUTH_SOCK,dst=/ssh-agent --env SSH_AUTH_SOCK=/ssh-agent` to `docker run`. If the key is already loaded into the agent, you do not need to mount the SSH key file into the container at all. ## Using Ansible via Docker @@ -88,7 +88,7 @@ docker run \ -w /work \ --mount type=bind,src=`pwd`,dst=/work \ --entrypoint=/bin/sh \ -ghcr.io/devture/ansible:14.0.0-r0-2 +ghcr.io/devture/ansible:14.0.0-r0-3 ``` Once you execute the above command, you'll be dropped into a `/work` directory inside a Docker container. The `/work` directory contains the playbook's code. @@ -109,7 +109,7 @@ docker run \ --mount type=bind,src=`pwd`,dst=/work \ --mount type=bind,src=$HOME/.ssh/id_ed25519,dst=/root/.ssh/id_ed25519,ro \ --entrypoint=/bin/sh \ -ghcr.io/devture/ansible:14.0.0-r0-2 +ghcr.io/devture/ansible:14.0.0-r0-3 ``` The above command tries to mount an SSH key (`$HOME/.ssh/id_ed25519`) into the container (at `/root/.ssh/id_ed25519`). If your SSH key is at a different path (not in `$HOME/.ssh/id_ed25519`), adjust that part.