Atom feed of this document
  
 

 Set environment variables using the OpenStack RC file

To set the required environment variables for the OpenStack command-line clients, you must create an environment file called an OpenStack rc file, or openrc.sh file. This project-specific environment file contains the credentials that all OpenStack services use.

When you source the file, environment variables are set for your current shell. The variables enable the OpenStack client commands to communicate with the OpenStack services that run in the cloud.

[Note]Note

Defining environment variables using an environment file is not a common practice on Microsoft Windows. Environment variables are usually defined in the Advanced tab of the System Properties dialog box.

 Create and source the OpenStack RC file

  1. In a text editor, create a file named PROJECT-openrc.sh file and add the following authentication information:

    The following example shows the information for a project called admin, where the OS username is also admin, and the identity host is located at controller.

    export OS_USERNAME=admin
    export OS_PASSWORD=ADMIN_PASS
    export OS_TENANT_NAME=admin
    export OS_AUTH_URL=http://controller:35357/v2.0
  2. On any shell from which you want to run OpenStack commands, source the PROJECT-openrc.sh file for the respective project. In this example, you source the admin-openrc.sh file for the admin project:

    $ source admin-openrc.sh

 Override environment variable values

When you run OpenStack client commands, you can override some environment variable settings by using the options that are listed at the end of the help output of the various client commands. For example, you can override the OS_PASSWORD setting in the PROJECT-openrc.sh file by specifying a password on a keystone command, as follows:

$ keystone --os-password PASSWORD service-list

Where PASSWORD is your password.

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page

loading table of contents...