commit 79d3af76368a6162f589264d4b9a1c0b2bc3bebb Author: Dmitry Tantsur Date: Mon Oct 5 17:45:48 2020 +0200 Explicitly unset OS_CLOUD in the generated openrc If running in an environment with OS_CLOUD already set, it takes priority over what we source from openrc. Unset it. Also always set OS_AUTH_TYPE for upgrade situations. Change-Id: I7cc14426c76aafdc1aa1c076b25d8cb4b262e855 diff --git a/playbooks/roles/bifrost-keystone-client-config/templates/openrc.j2 b/playbooks/roles/bifrost-keystone-client-config/templates/openrc.j2 index 3cc3512..d8860d6 100644 --- a/playbooks/roles/bifrost-keystone-client-config/templates/openrc.j2 +++ b/playbooks/roles/bifrost-keystone-client-config/templates/openrc.j2 @@ -1,7 +1,13 @@ #!/usr/bin/env bash # WARNING: This file is managed by bifrost. +for _os_key in $(set | awk '{FS="="} /^OS_/ {print $1}'); do + unset $_os_key; +done +unset _os_key + {% if enable_keystone | bool %} +export OS_AUTH_TYPE=password case "$1" in {% for cloud in clouds | default({}) | dictsort %} # Section for {{ cloud.0 }} @@ -23,7 +29,6 @@ export OS_ENDPOINT={{ ironic_api_url }} {% else %} export OS_AUTH_TYPE=http_basic export OS_ENDPOINT={{ ironic_api_url }} -unset OS_AUTH_URL case "${1:-bifrost}" in "bifrost") export OS_USERNAME="{{ default_username }}" diff --git a/releasenotes/notes/client-config-existing-8041abc5db164fd4.yaml b/releasenotes/notes/client-config-existing-8041abc5db164fd4.yaml new file mode 100644 index 0000000..daadb56 --- /dev/null +++ b/releasenotes/notes/client-config-existing-8041abc5db164fd4.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Unsets the ``OS_CLOUD`` variable in the generated ``openrc``. + - | + ``OS_AUTH_TYPE`` is now always set in the generated ``openrc``.