From 67c4a4f58e9b8af07c277b1f6c20fa7af116eaf7 Mon Sep 17 00:00:00 2001 From: John Fulton Date: Tue, 21 Jul 2020 21:27:18 +0000 Subject: [PATCH] Use ansible_user only if ANSIBLE_REMOTE_USER is unset In a non-standalone deployment config-download is called with the ANSIBLE_REMOTE_USER defined. This variable is undefined when using standalone, which is what caused the related bug. Unfortunately the fix for the related bug introduced the bug this patch closes. This patch should work for both non-standalone and standalone deployments. Change-Id: Ie7234bf113204e8cf847257554b88b899b45d5ee Related-Bug: #1886497 Closes-Bug: #1887708 --- .../tasks/create_ceph_ansible_remote_tmp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tripleo_ansible/roles/tripleo_ceph_run_ansible/tasks/create_ceph_ansible_remote_tmp.yml b/tripleo_ansible/roles/tripleo_ceph_run_ansible/tasks/create_ceph_ansible_remote_tmp.yml index 92d011722..23bfbd280 100644 --- a/tripleo_ansible/roles/tripleo_ceph_run_ansible/tasks/create_ceph_ansible_remote_tmp.yml +++ b/tripleo_ansible/roles/tripleo_ceph_run_ansible/tasks/create_ceph_ansible_remote_tmp.yml @@ -34,8 +34,8 @@ become: true file: path: "{{ ceph_ansible_remote_tmp }}" - owner: "{{ ansible_user | default('tripleo-admin', true) }}" - group: "{{ ansible_user | default('tripleo-admin', true) }}" + owner: "{{ lookup('env','ANSIBLE_REMOTE_USER') | default(ansible_user, true) }}" + group: "{{ lookup('env','ANSIBLE_REMOTE_USER') | default(ansible_user, true) }}" mode: "700" state: directory