Bug 1459707

Summary: [RFE] Switch undercloud and overcloud credential files to using os-client-config clouds.yaml
Product: Red Hat OpenStack Reporter: Graeme Gillies <ggillies>
Component: python-tripleoclientAssignee: RHOS Maint <rhos-maint>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: augol, beth.white, hbrock, jbuchta, jpichon, jslagle, kecarter, mburns
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://blueprints.launchpad.net/tripleo/+spec/os-client-config-switch
Whiteboard: NeedsAllocation
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-18 18:11:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Graeme Gillies 2017-06-07 23:31:59 UTC
Hi,

Currently both the undercloud (stackrc) and overcloud (overcloudrc) credential files make the user use environment variables for all the appropriate options. The limitations of environment variables is well understood, and when switching between the two can sometimes not be 100% clean (if you have options in 1 file but not the other, as environment variables aren't "unset").

The correct and future proof way of doing this is to use os-client-config and have TripleO correctly populate /home/stack/.config/openstack/clouds.yaml with the details of the two clouds (as they are created). An example copy of this file might look like

clouds:
  undercloud:
    auth:
      auth_url: http://192.0.2.1:35357/
      username: admin
      password: somepassword
      project_name: admin

  overcloud:
    auth:
      auth_url: https://cloud.example.com:13357/
      username: admin
      password: anotherpassword
      project_name: admin

Then a user has the option of using the command line tools against either cloud easily with

openstack --os-cloud undercloud server list

openstack --os-cloud overcloud server list

or

export OS_CLOUD=undercloud
openstack server list

export OS_CLOUD=overcloud
openstack server list

For backwards compatibility stackrc and overcloudrc files will remain but only export OS_CLOUD to the appropriate value.

This better aligns with the direction python-openstackclient wishes us to go, is more robust than environment variables and allows the operator greater customisation, as the operator can add extra options (like forcing api versions etc) in clouds.yaml themselves (which we will not overwrite).

On top of this, for users of tools such as python-shade and ansible (and other tools leveraging python-openstackclient programatically), this integration is a lot cleaner.

An intermediate step could be to generate both files (clouds.yaml and the old files)

Upstream blueprint

https://blueprints.launchpad.net/tripleo/+spec/os-client-config-switch

Comment 3 Julie Pichon 2018-06-14 14:43:25 UTC
This RFE is a bit wider than just the client work and also touches on tripleo-common, os-apply-config and tripleo-heat-templates at least. Unfortunately no one in the UI DFG has that breadth of knowledge at the moment, it would probably better for someone else to own this (DF?).

Comment 6 Julie Pichon 2019-10-29 10:12:11 UTC
Unassigning myself as I am not working on this... Comments on the upstream blueprint indicate this was implemented in Train/OSP16.

Comment 7 Kevin Carter 2020-11-18 18:11:27 UTC
We're currently generating a clouds yaml and rc files, as such we're closing this RFE. If there is a specific ask using our supported releases please reopen this RFE or create a new one.