Commit ec26a00
committed
update_ssh_config_guestfs: fix incorrect task privilege
This task does not require elevated privileges, so become: true is
unnecessary and can be removed. Its use was also causing the task to run
as root (the default become_user [1]), which led to the following error:
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
Ensure the task is only run when the conditions are appropiate, i.e.
when the file exists.
[1]
https://docs.ansible.com/ansible/latest/playbook_guide/
playbooks_privilege_escalation.html#become-directives
Fixes f301c9a ("guestfs: ensure right permissions for ssh config")
Reported-by: Chuck Lever <chuck.lever@oracle.com>
Closes: https://lore.kernel.org/all/b2fb6337-f737-4ab9-94a5-f6d5d94db749@oracle.com/
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Daniel Gomez <da.gomez@samsung.com>1 parent a0afdba commit ec26a00
1 file changed
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | 74 | | |
78 | 75 | | |
79 | 76 | | |
| 77 | + | |
0 commit comments