Skip to content

Commit b18acf6

Browse files
committed
template openrc and clouds.yaml
1 parent 62cc3e2 commit b18acf6

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

site-config/globals.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ keystone_identity_mappings:
8585
keystone_oidc_client_id: "keystone-ciab-dev"
8686
keystone_oidc_client_secret: "public"
8787

88+
identity_provider_name: "{{ keystone_identity_providers[0].name }}"
8889
identity_provider_url: "{{ keystone_identity_providers[0].identifier }}"
8990
keystone_oidc_provider_metadata_url: "{{ identity_provider_url }}/.well-known/openid-configuration"
9091
keystone_federation_oidc_jwks_uri: "{{ identity_provider_url }}/protocol/openid-connect/certs"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This is a clouds.yaml file, which can be used by OpenStack tools as a source
2+
# of configuration on how to connect to Chameleon.
3+
#
4+
# If you are only a member of one project, just put this file in
5+
# ~/.config/openstack/clouds.yaml and tools like the CLI will just work with no
6+
# further config. (You will need to add your password to the auth section)
7+
#
8+
# If you are a member of multiple projects, when invoking the CLI, provide
9+
# either the env variable OS_CLOUD=<project> or flag --os-cloud=<project> to
10+
# target your operation to the desired project, where <project> is the name
11+
# (or nickname, if set) of your project.
12+
13+
clouds:
14+
{% raw %}
15+
{{ cloud_name }}:
16+
auth:
17+
auth_url: {{ auth_url }}
18+
username: {{ user.username }}
19+
project_id: {{ tenant_id }}
20+
project_name: {{ tenant_name }}
21+
{% if user.is_federated %}
22+
protocol: openid
23+
{% endraw %}
24+
identity_provider: {{ identity_provider_name }}
25+
discovery_endpoint: {{ identity_provider_url }}/.well-known/openid-configuration
26+
client_id: {{ keystone_oidc_client_id }}
27+
{% raw %}
28+
access_token_type: access_token
29+
client_secret: none
30+
project_domain_name: {{ user_domain_name }}
31+
auth_type: v3oidcpassword
32+
{% else %}
33+
auth_type: v3password
34+
{% endif %}
35+
{% endraw %}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{% raw -%}
2+
{% load shellfilter %}#!/usr/bin/env bash
3+
export OS_AUTH_URL={{ auth_url }}/v3
4+
export OS_IDENTITY_API_VERSION=3
5+
export OS_INTERFACE={{ interface }}
6+
export OS_PROJECT_ID="{{ tenant_id|shellfilter }}"
7+
export OS_USERNAME="{{ user.username|shellfilter }}"
8+
{% if user.is_federated %}
9+
export OS_PROTOCOL="openid"
10+
export OS_AUTH_TYPE="v3oidcpassword"
11+
echo "($OS_USERNAME) Please enter your Chameleon CLI password: "
12+
read -sr OS_PASSWORD_INPUT
13+
export OS_PASSWORD=$OS_PASSWORD_INPUT
14+
{% endraw %}
15+
export OS_IDENTITY_PROVIDER="{{ identity_provider_name }}"
16+
export OS_DISCOVERY_ENDPOINT="{{ identity_provider_url }}/.well-known/openid-configuration"
17+
export OS_CLIENT_ID="{{ keystone_oidc_client_id | default(none) }}"
18+
export OS_ACCESS_TOKEN_TYPE="access_token"
19+
{% raw -%}
20+
export OS_CLIENT_SECRET="none"
21+
{% else %}
22+
export OS_USER_DOMAIN_NAME="{{ user_domain_name|shellfilter }}"
23+
if [ -z "$OS_USER_DOMAIN_NAME" ]; then unset OS_USER_DOMAIN_NAME; fi
24+
export OS_AUTH_TYPE="password"
25+
echo "($OS_USERNAME) Please enter your Chameleon password: "
26+
read -sr OS_PASSWORD_INPUT
27+
export OS_PASSWORD=$OS_PASSWORD_INPUT
28+
{% endif %}
29+
export OS_REGION_NAME="{{ region|shellfilter }}"
30+
if [ -z "$OS_REGION_NAME" ]; then unset OS_REGION_NAME; fi
31+
{% endraw %}

0 commit comments

Comments
 (0)