Dmitry Tantsur bcda97b630 Support HTTP basic auth and switch bifrost-cli to it
The voting jobs also use the new mode (since it requires more OS
coverage), the DHCP jobs are left with no-auth.

Change-Id: I8c8ee112edbc1e61b54aff13c06c518c7daa9700
2020-08-07 15:21:27 +02:00

39 lines
1.4 KiB
Django/Jinja

#!/usr/bin/env bash
# WARNING: This file is managed by bifrost.
{% if enable_keystone | bool %}
case "$1" in
{% for cloud in clouds | default({}) | dictsort %}
# Section for {{ cloud.0 }}
"{{ cloud.0 }}")
export OS_PROJECT_DOMAIN_NAME="{{ cloud.1.config_project_domain_id | default('default') }}"
export OS_USER_DOMAIN_NAME="{{ cloud.1.config_user_domain_id | default('default') }}"
export OS_PROJECT_NAME="{{ cloud.1.config_project_name }}"
export OS_USERNAME="{{ cloud.1.config_username }}"
export OS_PASSWORD="{{ cloud.1.config_password }}"
export OS_AUTH_URL={{ cloud.1.config_auth_url }}
export OS_IDENTITY_API_VERSION=3
;;
{% endfor %}
*) echo -e "\nERROR unsupported or unspecified profile: $1\nMust be one of {{ clouds | default({}) | dictsort | map(attribute='0') | join(',') }}";;
esac
{% elif noauth_mode | bool %}
export OS_AUTH_TYPE=none
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 }}"
export OS_PASSWORD="{{ default_password }}"
;;
"bifrost-admin")
export OS_USERNAME="{{ admin_username }}"
export OS_PASSWORD="{{ admin_password }}"
;;
*) echo -e "\nERROR unsupported or unspecified profile: $1\nMust be one of bifrost, bifrost-admin";;
esac
{% endif %}