Skip to content

Commit 6969e1d

Browse files
Valkyrie00danpawlik
authored andcommitted
fix: use ansible_user_id instead of ansible_user in libvirt_manager_user
Replace ansible_user with ansible_user_id in cifmw_libvirt_manager_user variable to fix SSH key ownership issues when running with ansible_connection=local. When deploying locally (not through testproject automation), ansible_user can become undefined with ansible_connection=local, causing the fallback lookup('env', 'USER') to return 'root' instead of the intended user. This resulted in SSH keys being created with root:root ownership, leading to permission denied errors when the user tried to connect to compute nodes. The switch to ansible_user_id correctly detects the user even with local connections and resolves the file ownership problem.
1 parent bcdd70e commit 6969e1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

roles/libvirt_manager/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
cifmw_libvirt_manager_basedir: "{{ cifmw_basedir | default( ansible_user_dir ~ '/ci-framework-data') }}"
2222
cifmw_libvirt_manager_enable_virtualization_module: false
23-
cifmw_libvirt_manager_user: "{{ ansible_user | default(lookup('env', 'USER')) }}"
23+
cifmw_libvirt_manager_user: "{{ ansible_user_id | default(lookup('env', 'USER')) }}"
2424
cifmw_libvirt_manager_images_url: https://cloud.centos.org/centos/9-stream/x86_64/images
2525
cifmw_libvirt_manager_vm_template: "domain.xml.j2"
2626

0 commit comments

Comments
 (0)