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
This commit is contained in:
John Fulton 2020-07-21 21:27:18 +00:00
parent 680b4ea1c3
commit 67c4a4f58e
1 changed files with 2 additions and 2 deletions

View File

@ -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