From e3d123675873370eb1d77d596caba8577fba5e82 Mon Sep 17 00:00:00 2001 From: Daniel Pawlik Date: Fri, 30 Jan 2026 14:46:47 +0100 Subject: [PATCH] Replace ansible_user_dir to /home/zuul when it is pointing to Zuul HOME In some case, when we read variables from group_vars, HOME dir can be pointing to /var/lib/zuul, when it is not nested ansible execution. In that case, to avoid error that we might be pointing to the Zuul dir which is restricted or when the delegation would be use, safe way would be to replace Zuul HOME dir to /home/zuul, which is used in mostly. Signed-off-by: Daniel Pawlik --- group_vars/all.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index bdd0aa0ed..b18e07409 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -2,7 +2,13 @@ # This file contains all repeating variables, that can be set # globally instead of parse Zuul inventory file to get proper value. #### GLOBAL VARS #### -ansible_user_dir: "{{ lookup('env', 'HOME') }}" +# NOTE(dpawlik): In some case, when we read variables from group_vars, +# HOME dir can be pointing to /var/lib/zuul, when it is not nested +# ansible execution. In that case, to avoid error that we might be +# pointing to the Zuul dir which is restricted or when the delegation +# would be use, safe way would be to replace Zuul HOME dir to +# /home/zuul, which is used in mostly. +ansible_user_dir: "{{ lookup('env', 'HOME') | replace('/var/lib/zuul', '/home/zuul') }}" cifmw_repo_relative: src/github.com/openstack-k8s-operators/ci-framework cifmw_repo: "{{ ansible_user_dir }}/{{ cifmw_repo_relative }}" cifmw_installyamls_repos_relative: src/github.com/openstack-k8s-operators/install_yamls