Does not work if v3 API variables are set in the environment
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
puppet-keystone |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hello,
following the documentation in the modules, the following environmental variables should work for puppet-keystone to function with the v3 Keystone API:
# To be sure everything is working, run:
# $ export OS_IDENTITY_
# $ export OS_USERNAME=admin
# $ export OS_USER_
# $ export OS_PASSWORD=
# $ export OS_PROJECT_
# $ export OS_PROJECT_
# $ export OS_AUTH_URL=http://
If these are set, calling keystone_endpoint will fail. The keystone_endpoint provider tries to call the "openstack" client with v2 syntax, as can be seen:
Error: Could not prefetch keystone_endpoint provider 'openstack': Execution of '/usr/bin/openstack endpoint list --quiet --format csv --long' returned 2: usage: openstack endpoint list [-h] [-f {csv,html,
openstack endpoint list: error: unrecognized arguments: --long
Error: /Stage[
openstack endpoint create: error: argument <interface>: invalid choice: 'http://
In fact, the "openstack" client changes its supported arguments depending on the OS_IDENTITY_
The catastrophy becomes complete if there is a file called /root/openrc -- obviously, openstacklib tries to load that file and takes its environment from there. As a consequence, puppet runs can not be completed with puppet-keystone as most providers in puppet-keystone now rely on the v3 API, except for the keystone_endpoint provider, that needs the v2 API.
keystone_endpoint needs to be ported to support the new way of specifying admin, internal and public URLs and should not rely on the V2 API anymore.
description: | updated |
I believe there is a misunderstanding with the "# To be sure everything is working, run:" part.
The intend is to verify that everything is working 'after' running the installation. API_VERSION and OS_AUTH_URL to API v3 and that cannot effectively work with the keystone_endpoint provider which is still implemented for v2.
The reason that fails is because it effectively forces the OS_IDENTITY_
The reason the endpoint provider is created under v2 is because the v3 endpoint is not visible (compatible) for v2 and because currently puppet-keystone is providing support across both API versions.
To be able to bootstrap Keystone installation properly, I would not recommend to have an openrc or any openstack variables preset.
Once V2 API support would be dropped from puppet-keystone, Keystone V3 endpoint would work just fine.
That said, presetting environment variables to V2 wouldn't help either.