diff options
author | Mark Asselstine <mark.asselstine@windriver.com> | 2017-12-01 15:13:33 -0500 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-12-01 21:46:36 -0500 |
commit | f793205c73a006734b84c708f49049a1067f6b6a (patch) | |
tree | d351449740107908abc11ae6c563989fb7ec868f | |
parent | ee1c631b92752742d89b311f4774d7017a946d54 (diff) | |
download | meta-cloud-services-f793205c73a006734b84c708f49049a1067f6b6a.tar.gz |
python-keystone: generate admin-openrc
In order to interact with the openstack CLI commands it is common
practice to source *openrc files which populate the environment with a
base set of values. See
https://docs.openstack.org/keystone/pike/install/keystone-openrc-obs.html
We used to do this as part of nova but it makes more sense to create
these as part of keystone. This makes them available early in the
setup process and also maps with the keystone bootstrapping.
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r-- | meta-openstack/recipes-devtools/python/python-keystone/admin-openrc | 12 | ||||
-rw-r--r-- | meta-openstack/recipes-devtools/python/python-keystone_git.bb | 8 |
2 files changed, 20 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-keystone/admin-openrc b/meta-openstack/recipes-devtools/python/python-keystone/admin-openrc new file mode 100644 index 0000000..4b459d7 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-keystone/admin-openrc | |||
@@ -0,0 +1,12 @@ | |||
1 | # | ||
2 | # Matches bootstrap data in keystone-init | ||
3 | # | ||
4 | export OS_PROJECT_DOMAIN_NAME=Default | ||
5 | export OS_USER_DOMAIN_NAME=Default | ||
6 | export OS_PROJECT_NAME=admin | ||
7 | export OS_USERNAME=%ADMIN_USER% | ||
8 | export OS_PASSWORD=%ADMIN_PASSWORD% | ||
9 | export OS_AUTH_URL=http://%CONTROLLER_IP%:35357/v3 | ||
10 | export OS_IDENTITY_API_VERSION=3 | ||
11 | export OS_IMAGE_API_VERSION=2 | ||
12 | export OS_REGION_NAME=RegionOne | ||
diff --git a/meta-openstack/recipes-devtools/python/python-keystone_git.bb b/meta-openstack/recipes-devtools/python/python-keystone_git.bb index c3437cd..118574b 100644 --- a/meta-openstack/recipes-devtools/python/python-keystone_git.bb +++ b/meta-openstack/recipes-devtools/python/python-keystone_git.bb | |||
@@ -13,6 +13,7 @@ SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/pike \ | |||
13 | file://identity.sh \ | 13 | file://identity.sh \ |
14 | file://convert_keystone_backend.py \ | 14 | file://convert_keystone_backend.py \ |
15 | file://wsgi-keystone.conf \ | 15 | file://wsgi-keystone.conf \ |
16 | file://admin-openrc \ | ||
16 | " | 17 | " |
17 | 18 | ||
18 | # TBD: update or drop | 19 | # TBD: update or drop |
@@ -92,6 +93,13 @@ do_install_append() { | |||
92 | sed -e "s:%ADMIN_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${KS_INIT_FILE} | 93 | sed -e "s:%ADMIN_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${KS_INIT_FILE} |
93 | sed -e "s:%ADMIN_ROLE%:${ADMIN_ROLE}:g" -i ${KS_INIT_FILE} | 94 | sed -e "s:%ADMIN_ROLE%:${ADMIN_ROLE}:g" -i ${KS_INIT_FILE} |
94 | 95 | ||
96 | # Setup the admin-openrc file | ||
97 | KS_OPENRC_FILE=${KEYSTONE_CONF_DIR}/admin-openrc | ||
98 | install -m 600 ${WORKDIR}/admin-openrc ${KS_OPENRC_FILE} | ||
99 | sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${KS_OPENRC_FILE} | ||
100 | sed -e "s:%ADMIN_USER%:${ADMIN_USER}:g" -i ${KS_OPENRC_FILE} | ||
101 | sed -e "s:%ADMIN_PASSWORD%:${ADMIN_PASSWORD}:g" -i ${KS_OPENRC_FILE} | ||
102 | |||
95 | # Install various configuration files. We have to select suitable | 103 | # Install various configuration files. We have to select suitable |
96 | # permissions as packages such as Apache require read access. | 104 | # permissions as packages such as Apache require read access. |
97 | # | 105 | # |