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
This commit is contained in:
Julia Kreger 2017-04-04 14:23:36 +00:00
parent 6109f824e5
commit d29a371e4a
2 changed files with 7 additions and 1 deletions

View File

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

View File

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