aboutsummaryrefslogtreecommitdiff
path: root/ansible/library
diff options
context:
space:
mode:
authorBertrand Lanson <bertrand.lanson@infomaniak.com>2026-05-21 10:43:40 +0200
committerBertrand Lanson <bertrand.lanson@infomaniak.com>2026-06-22 14:21:26 +0200
commit20a056012273d103ff24b31541b6bbb746b10180 (patch)
tree18e0abd5efb751f929e147e97b5181e32fa6062b /ansible/library
parent3082ed5b28229389bc47bb5ef03a935ec47e4c59 (diff)
downloadkolla-ansible-20a056012273d103ff24b31541b6bbb746b10180.tar.gz
kolla-ansible-20a056012273d103ff24b31541b6bbb746b10180.zip
fix kolla_toolbox running with wrong HOME env
There is a possibility that the ansible-runner in kolla_toolbox is executed with the wrong environment variables if run in a specific way. The cause is not super clear, but the solution is to simply force it to use the correct HOME value. Closes-Bug: #2153544 Change-Id: Ibad84e358f21564c570161f7e4f21b117398df3b Signed-off-by: Bertrand Lanson <bertrand.lanson@infomaniak.com> (cherry picked from commit 2104f74a2616821c2bd848411ebfce266a3edd69)
Diffstat (limited to 'ansible/library')
-rw-r--r--ansible/library/kolla_toolbox.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ansible/library/kolla_toolbox.py b/ansible/library/kolla_toolbox.py
index 2749f3b4b..faa67dbe9 100644
--- a/ansible/library/kolla_toolbox.py
+++ b/ansible/library/kolla_toolbox.py
@@ -382,7 +382,10 @@ class KollaToolboxWorker():
try:
self._push_private_data_dir(kolla_toolbox, pdd, user)
+ exec_user = user or 'ansible'
runner_env = {}
+ if exec_user == 'ansible':
+ runner_env['HOME'] = _PDD_BASEDIR
if self.module._diff:
runner_env['ANSIBLE_DIFF_MODE'] = '1'
@@ -391,7 +394,7 @@ class KollaToolboxWorker():
['/opt/ansible/bin/ansible-runner', 'run', pdd,
'--playbook', 'main.json',
'--rotate-artifacts', '1'],
- user=user,
+ user=exec_user,
environment=runner_env
)
# exit 2 = task failed/unreachable; handled via event below.