Cleanup openrc.sh creation and usage

Consistently create and use PROJECT-openrc.sh files. This is the default
when you use the dashboard, so let's follow this everywhere. This makes
it also clearer which project is used.

Change-Id: I5e4604ed61b29e86193697171a9fc84f673fc102
Partial-Bug: #1290082
This commit is contained in:
Andreas Jaeger 2014-04-14 20:01:21 +02:00
parent 4588778170
commit 69afda54b5
8 changed files with 74 additions and 28 deletions

View File

@ -160,7 +160,8 @@
lets you update or remove a package. After you install the
clients, you must source an <filename
xmlns:raxm="http://docs.rackspace.com/api/metadata"
>openrc.sh</filename> file to set required environment
><replaceable>PROJECT</replaceable>-openrc.sh</filename>
file to set required environment
variables before you can request OpenStack services
through the clients or the APIs.</para>
<procedure>
@ -227,7 +228,8 @@
</step>
<step audience="enduser">
<para>Before you can run client commands, you must
create and source the <filename>openrc.sh</filename>
create and source the
<filename><replaceable>PROJECT</replaceable>-openrc.sh</filename>
file to set environment variables. See <xref
linkend="cli_openrc"/>.</para>
</step>

View File

@ -34,14 +34,20 @@
&amp; Security</guibutton>.</para>
</step>
<step>
<para>Click on the API Access tab.
Click <guibutton>Download OpenStack RC File</guibutton>
and save the file.</para>
<para>
Click on the API Access tab. Click
<guibutton>Download OpenStack RC File</guibutton>
and save the file. The filename will be of the form
<filename><replaceable>PROJECT</replaceable>-openrc.sh</filename>
where <replaceable>PROJECT</replaceable> is the name
of the project for which you downloaded the file.
</para>
</step>
<step>
<para>Copy the <filename>openrc.sh</filename> file to
the machine from where you want to run OpenStack
commands.</para>
<para>Copy the
<filename><replaceable>PROJECT</replaceable>-openrc.sh</filename>
file to the machine from where you want to run
OpenStack commands.</para>
<para>For example, copy the file to the machine from
where you want to upload an image with a glance
client command.</para>
@ -49,8 +55,8 @@
<step>
<para>On any shell from where you want to run
OpenStack commands, source the
<filename>openrc.sh</filename> file for the
respective project.</para>
<filename><replaceable>PROJECT</replaceable>-openrc.sh</filename>
file for the respective project.</para>
<para>In this example, you source the
<filename>demo-openrc.sh</filename> file for
the demo project:</para>
@ -59,18 +65,19 @@
<step>
<para>When you are prompted for an OpenStack password,
enter the password for the user who downloaded the
<filename>openrc.sh</filename> file.</para>
<filename><replaceable>PROJECT</replaceable>-openrc.sh</filename>
file.</para>
</step>
</procedure>
</section>
<section xml:id="openrc-create">
<title>Create and source the OpenStack RC file</title>
<para audience="enduser">Alternatively, you can create the
<filename>openrc.sh</filename> file from
<filename><replaceable>PROJECT</replaceable>-openrc.sh</filename> file from
scratch.</para>
<procedure>
<step>
<para>Create the <filename>openrc.sh</filename> file
<para>Create the <filename><replaceable>PROJECT</replaceable>-openrc.sh</filename> file
and add the authentication information:</para>
<programlisting language="bash" audience="enduser">export OS_USERNAME=<replaceable>USERNAME</replaceable>
export OS_PASSWORD=<replaceable>PASSWORD</replaceable>
@ -87,15 +94,19 @@ export OS_AUTH_URL=http://<replaceable>controller</replaceable>:35357/v2.0</prog
<step>
<para>On any shell from where you want to run
OpenStack commands, source the
<filename>openrc.sh</filename> file for the
respective project:</para>
<screen><prompt>$</prompt> <userinput>source openrc.sh</userinput></screen>
<filename><replaceable>PROJECT</replaceable>-openrc.sh</filename>
file for the
respective project. In this example, you source the
<filename>admin-openrc.sh</filename> file for
the <replaceable>admin</replaceable> project:</para>
<screen><prompt>$</prompt> <userinput>source admin-openrc.sh</userinput></screen>
</step>
</procedure>
<note audience="enduser">
<para>You are not prompted for the password with this
method. The password lives in clear text format in the
<filename>openrc.sh</filename> file. Restrict the
<filename><replaceable>PROJECT</replaceable>-openrc.sh</filename>
file. Restrict the
permissions on this file to avoid security problems.
You can also remove the <literal>OS_PASSWORD</literal>
variable from the file, and use the
@ -110,7 +121,8 @@ export OS_AUTH_URL=http://<replaceable>controller</replaceable>:35357/v2.0</prog
that are listed at the end of the <command>nova
help</command> output. For example, you can override
the <option>OS_PASSWORD</option> setting in the
<filename>openrc.sh</filename> file by specifying a
<filename><replaceable>PROJECT</replaceable>-openrc.sh</filename>
file by specifying a
password on a <command>nova</command> command, as follows:</para>
<screen><prompt>$</prompt> <userinput>nova --password &lt;password> image-list</userinput></screen>
<para>Where <parameter>password</parameter> is your

View File

@ -15,4 +15,34 @@
<xi:include href="../common/section_cli_overview.xml"/>
<xi:include href="../common/section_cli_install.xml"/>
<xi:include href="../common/section_cli_openrc.xml"/>
<section xml:id="ch_clients_openrc_files">
<title>Create openrc.sh files</title>
<para>
As explained in <xref linkend="openrc-create"/>,
<phrase os="rhel;centos;fedora;opensuse;sles;ubuntu"> use the
credentials from <xref linkend="keystone-users"/> and</phrase>
create the following
<filename><replaceable>PROJECT</replaceable>-openrc.sh</filename>
files:
</para>
<itemizedlist>
<listitem>
<para>
<filename>admin-openrc.sh</filename> for the administrative user
</para>
</listitem>
<listitem>
<para>
<filename>demo-openrc.sh</filename> for the normal user:
<programlisting language="bash" audience="installer">export OS_USERNAME=demo
export OS_PASSWORD=<replaceable>DEMO_PASS</replaceable>
export OS_TENANT_NAME=demo
export OS_AUTH_URL=http://<replaceable>controller</replaceable>:35357/v2.0</programlisting>
</para>
</listitem>
</itemizedlist>
</section>
</chapter>

View File

@ -9,8 +9,8 @@
<procedure>
<step>
<para>Make sure that your credentials are set up correctly in the
<filename>openrc.sh</filename> file and source it:</para>
<screen><prompt>$</prompt> <userinput>source openrc.sh</userinput></screen>
<filename>admin-openrc.sh</filename> file and source it:</para>
<screen><prompt>$</prompt> <userinput>source admin-openrc.sh</userinput></screen>
</step>
<step><para>Run the following <command>swift</command> command:</para>
<screen><prompt>$</prompt> <userinput>swift stat</userinput>

View File

@ -106,7 +106,7 @@
</varlistentry>
</variablelist>
<para>For example:</para>
<screen><prompt>$</prompt> <userinput>source openrc.sh</userinput>
<screen><prompt>$</prompt> <userinput>source admin-openrc.sh</userinput>
<prompt>$</prompt> <userinput>glance image-create --name "cirros-0.3.2-x86_64" --disk-format qcow2 \
--container-format bare --is-public True --progress &lt; cirros-0.3.2-x86_64-disk.img</userinput>
<computeroutput>+------------------+--------------------------------------+

View File

@ -7,9 +7,9 @@
<para>To verify that the Orchestration service is installed and configured
correctly, make sure that your credentials are set up correctly in the
<filename>openrc.sh</filename> file. Source the file, as follows:</para>
<filename>demo-openrc.sh</filename> file. Source the file, as follows:</para>
<screen><prompt>$</prompt> <userinput>source openrc.sh</userinput></screen>
<screen><prompt>$</prompt> <userinput>source demo-openrc.sh</userinput></screen>
<para>Next, create some stacks by using the samples.</para>
<xi:include href="../user-guide/section_cli_heat.xml"/>

View File

@ -43,7 +43,7 @@
<step>
<para>You can also set your <literal>--os-*</literal> variables
in your environment to simplify command-line usage. Set up a
<filename>openrc.sh</filename> file with the admin
<filename>admin-openrc.sh</filename> file with the admin
credentials and admin endpoint:</para>
<programlisting language="bash">export OS_USERNAME=admin
export OS_PASSWORD=<replaceable>ADMIN_PASS</replaceable>
@ -53,10 +53,10 @@ export OS_AUTH_URL=http://controller:35357/v2.0</programlisting>
<step>
<para>Source this file to read in the environment
variables:</para>
<screen><prompt>$</prompt> <userinput>source openrc.sh</userinput></screen>
<screen><prompt>$</prompt> <userinput>source admin-openrc.sh</userinput></screen>
</step>
<step>
<para>Verify that your <filename>openrc.sh</filename> file is
<para>Verify that your <filename>admin-openrc.sh</filename> file is
configured correctly. Run the same command without the
<literal>--os-*</literal> arguments:</para>
<screen><prompt>$</prompt> <userinput>keystone token-get</userinput></screen>

View File

@ -13,8 +13,10 @@ xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="sdk_auth">
credentials contained in the
<link linkend="cli_openrc">OpenStack RC file</link>. Because credentials
are sensitive information, do not include them in your scripts. This guide
assumes that users source the <filename>openrc.sh</filename> file and access
the credentials by using the environment variables in the Python scripts.</para>
assumes that users source the
<filename><replaceable>PROJECT</replaceable>-openrc.sh</filename>
file and access the credentials by using the environment variables
in the Python scripts.</para>
<xi:include href="section_sdk_auth_keystone.xml"/>
<xi:include href="section_sdk_auth_glance.xml"/>
<xi:include href="section_sdk_auth_nova.xml"/>