All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: <kdevops@lists.linux.dev>
Cc: Daniel Gomez <da.gomez@kernel.org>, Chuck Lever <chuck.lever@oracle.com>
Subject: [RFC PATCH 2/2] ansible.cfg: Explicitly set the ssh user
Date: Tue, 15 Jul 2025 20:11:17 -0400	[thread overview]
Message-ID: <20250716001117.1125930-2-cel@kernel.org> (raw)
In-Reply-To: <20250716001117.1125930-1-cel@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

I've been seeing tasks that are marked "become: true" fail with
this message:

  Timeout (12s): waiting for privilege escalation promt:

This appears to be a common failure mode, but it is due to a broad
variety of causes. I think I've nailed this one with this addition
to ansible.cfg. It changes "ESTABLISHING SSH SESSION FOR: NONE"
to "... FOR: <user>" where <user> is always a user that is allowed
to use sudo.

The current Terraform Kconfig menu sets this user, but guestfs does
not -- the Ansible ssh user for guestfs is always "kdevops". The
ansible.cfg.j2 file reflects this.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 playbooks/roles/ansible_cfg/templates/ansible.cfg.j2 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2 b/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
index f71033b2c88f..60525506335c 100644
--- a/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
+++ b/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
@@ -11,6 +11,11 @@ show_task_path_on_failure = {{ ansible_cfg_callback_plugin_show_task_path_on_fai
 interpreter_python = {{ ansible_cfg_interpreter_python_string }}
 forks = {{ ansible_cfg_forks }}
 enable_task_debugger = {{ ansible_cfg_task_debugger }}
+{% if ssh_config_user is defined %}
+remote_user = {{ ssh_config_user }}
+{% else %}
+remote_user = kdevops
+{% endif %}
 {% if ansible_facts['distribution'] == 'openSUSE' %}
 [connection]
 retries = {{ ansible_cfg_reconnection_retries }}
-- 
2.50.0


  reply	other threads:[~2025-07-16  0:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-16  0:11 [RFC PATCH 1/2] ansible.cfg: Enable the Ansible debugger when a task fails Chuck Lever
2025-07-16  0:11 ` Chuck Lever [this message]
2025-07-16 18:05   ` [RFC PATCH 2/2] ansible.cfg: Explicitly set the ssh user Daniel Gomez
2025-07-16 18:47     ` Chuck Lever
2025-07-16 17:44 ` [RFC PATCH 1/2] ansible.cfg: Enable the Ansible debugger when a task fails Daniel Gomez
2025-07-16 18:38   ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250716001117.1125930-2-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=da.gomez@kernel.org \
    --cc=kdevops@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.