* file (/root/.ssh/config) is absent, cannot continue
@ 2025-05-19 18:34 Chuck Lever
2025-05-19 18:55 ` Daniel Gomez
0 siblings, 1 reply; 3+ messages in thread
From: Chuck Lever @ 2025-05-19 18:34 UTC (permalink / raw)
To: Daniel Gomez; +Cc: kdevops@lists.linux.dev
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
Could be commit 5095f06310c0 ("update_ssh_config_guestfs: fix broken
conditionals") -- I reverted that commit and the issue goes away.
--
Chuck Lever
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: file (/root/.ssh/config) is absent, cannot continue
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
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Gomez @ 2025-05-19 18:55 UTC (permalink / raw)
To: Chuck Lever; +Cc: kdevops@lists.linux.dev
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.
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?
>
>
> 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.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: file (/root/.ssh/config) is absent, cannot continue
2025-05-19 18:55 ` Daniel Gomez
@ 2025-05-19 21:14 ` Chuck Lever
0 siblings, 0 replies; 3+ messages in thread
From: Chuck Lever @ 2025-05-19 21:14 UTC (permalink / raw)
To: da.gomez; +Cc: kdevops@lists.linux.dev
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-19 21:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox