From: Chuck Lever <chuck.lever@oracle.com>
To: da.gomez@kernel.org
Cc: "kdevops@lists.linux.dev" <kdevops@lists.linux.dev>
Subject: Re: file (/root/.ssh/config) is absent, cannot continue
Date: Mon, 19 May 2025 17:14:33 -0400 [thread overview]
Message-ID: <a16287a0-5edc-40a6-b580-bb34b763c2c0@oracle.com> (raw)
In-Reply-To: <49a696f8-3909-4cc5-81d5-7b3291090b1a@kernel.org>
On 5/19/25 2:55 PM, Daniel Gomez wrote:
>
>
> On 19/05/2025 20.34, Chuck Lever wrote:
>> I updated to the tip of the kdevops branch just now, and
>> update_ssh_config_guestfs is suddenly failing:
>>
>>
>> task path:
>> /home/cel/src/kdevops/buildbot-configs/playbooks/roles/
>> update_ssh_config_guestfs/tasks/main.yml:73
>> fatal: [localhost]: FAILED! => {
>> "changed": false,
>> "path": "/root/.ssh/config",
>> "state": "absent"
>> }
>>
>> MSG:
>>
>> file (/root/.ssh/config) is absent, cannot continue
>
> Looks weird it's trying to access the ./ssh/config for root instead of cel.
The pathname should be KDEVOPS_SSH_CONFIG, but that needs to be
fixed throughout update_ssh_config_guestfs.yml.
> Line 73 points to:
>
> - name: Ensure ~/.ssh/config permissions
> become: true
> become_flags: 'su - -c'
> become_method: ansible.builtin.sudo
> ansible.builtin.file:
> path: ~/.ssh/config
> mode: "0600"
>
> which I think is missing:
>
> when: ssh_config.stat.exists
>
> Added by the change f301c9a ("guestfs: ensure right permissions for ssh
> config").
>
> I don't think we need to use sudo in that task either:
>
> become_flags: 'su - -c'
> become_method: ansible.builtin.sudo
>
>
> Can you try adding the when conditional and sudo?
I tested:
diff --git a/playbooks/roles/update_ssh_config_guestfs/tasks/main.yml
b/playbooks/roles/update_ssh_config_guestfs/tasks/main.yml
index 6c6c49034d8a..ee144b3f4796 100644
--- a/playbooks/roles/update_ssh_config_guestfs/tasks/main.yml
+++ b/playbooks/roles/update_ssh_config_guestfs/tasks/main.yml
@@ -71,9 +71,7 @@
Include ~/.ssh/config_kdevops_*
- name: Ensure ~/.ssh/config permissions
- become: true
- become_flags: 'su - -c'
- become_method: ansible.builtin.sudo
ansible.builtin.file:
path: ~/.ssh/config
mode: "0600"
+ when: ssh_config.stat.exists
I'm not able to reproduce the issue.
>> Could be commit 5095f06310c0 ("update_ssh_config_guestfs: fix broken
>> conditionals") -- I reverted that commit and the issue goes away.
>>
> This commit just adds | bool to the conditions. That might have been
> silently masking the issue.
>
--
Chuck Lever
prev parent reply other threads:[~2025-05-19 21:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-19 18:34 file (/root/.ssh/config) is absent, cannot continue Chuck Lever
2025-05-19 18:55 ` Daniel Gomez
2025-05-19 21:14 ` Chuck Lever [this message]
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=a16287a0-5edc-40a6-b580-bb34b763c2c0@oracle.com \
--to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox