From d29a371e4a7618dbe6b2727dc2262e3f1bcc7acd Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Tue, 4 Apr 2017 14:23:36 +0000 Subject: [PATCH] Provide fallback variable if sudo is not used install.yaml only previously only supported reading the user that was executing sudo, although no fallback was provided. If the value is not defined, we should fallback. Change-Id: I2ddfe2ff7ff13ed53bd9a2838ea2108afe89dc88 Closes-Bug: #1679711 --- playbooks/install.yaml | 2 +- .../notes/install-SUDO_USER-fix-2bf577269008587f.yaml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/install-SUDO_USER-fix-2bf577269008587f.yaml diff --git a/playbooks/install.yaml b/playbooks/install.yaml index c0bd45f5f..cfffa2610 100644 --- a/playbooks/install.yaml +++ b/playbooks/install.yaml @@ -8,7 +8,7 @@ - bifrost-keystone-install - bifrost-ironic-install - role: bifrost-keystone-client-config - user: "{{ ansible_env.SUDO_USER }}" + user: "{{ ansible_env.SUDO_USER | default(ansible_user_id) }}" clouds: bifrost: config_username: "{{ ironic.keystone.default_username }}" diff --git a/releasenotes/notes/install-SUDO_USER-fix-2bf577269008587f.yaml b/releasenotes/notes/install-SUDO_USER-fix-2bf577269008587f.yaml new file mode 100644 index 000000000..25c15019c --- /dev/null +++ b/releasenotes/notes/install-SUDO_USER-fix-2bf577269008587f.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Corrects an issue where execution of ``install.yaml`` would return + an error indicating ``SUDO_USER`` was not found, by providing a fallback + to the ``ansible_user_id`` variable.