How do I get the clouds.yaml file

Asked by Matthew

I have been trying to create a CI setup that would allow an environment to be spun up, configured and then tested. As part of this I want to be able to provision the openstack instances.

I found this client and the associated documentation at https://docs.openstack.org/user-guide/common/cli-overview.html

This documentation talks about a clouds.yaml file which can provide the default settings to use. I am not easily able to generate this file.

When I log into the openstack instance using the web interface I am able to download a juju environments.yaml file which looks like:

```
# To use Juju with your Openstack cloud:
# 1. Run: apt-get install juju
# 2. Copy this file to $HOME/.juju/environments.yaml
# 3. Complete any empty fields
# 4. Run 'juju bootstrap' and deploy services!
#
# To find out more about juju visit http://juju.ubuntu.com
environments:
  openstack:
    type: openstack
    auth-url: http://xxxx/v2.0
    auth-mode: userpass
    use-floating-ip: true
    # Please provide the UUID of the network to use if you have
    # more than one network configured for your tenant.
    # network:
    region: SOMEWHERE
    username: matthew
    # Please provide the password you use to access the
    # OpenStack cloud.
    password:
    tenant-name: PROJECT_NAME?
```

I attempted to rewrite this to the clouds.yaml format:

```
clouds:
  openstack:
    auth:
      auth-url: http://xxxx/v2.0
      username: matthew
      project_name: PROJECT_NAME?
```

When I run the `openstack container list` command it does not appear to pick this up.
(I am using this command because it looks like a simple non destructive command I can use to test that the client is able to connect to openstack):

➜ openstack container list
Missing value auth-url required for auth plugin password

The clouds.yaml file is in the directory that I am running this from and so based on https://docs.openstack.org/developer/python-openstackclient/man/openstack.html#cloud-configuration this should be loaded by the command line client.

When I explicitly pass the parameters to the client, I get a separate error:

➜ openstack --os-auth-url 'http://xxxx/v2.0' --os-project-name 'PROJECT_NAME?' --os-username matthew container list
Password:
public endpoint for object-store service not found

I realise that since a juju configuration exists I may well use that, however I found the portability and self contained nature of the python client to be quite desirable. Using pyenv I am able to completely compartmentalise this into a single project, while juju desires systemwide access.

In a broad sense, this ticket is about the fact that I did not configure or create the openstack setup. I just use it. As part of using it I want to be able to automate using it. When talking about these configuration files and configuration settings it would be very helpful to explain how to derive the values for them. For example, I literally have no idea how to deduce the auth url. It certainly does not look like anything that I use when using the web interface.

(I realise this is a public bug tracker so I have attempted to minimise any potentially sensitive information that this ticket discloses. Please let me know if that is a problem).

Question information

Language:
English Edit question
Status:
Expired
For:
python-openstackclient Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.