Merge "Stop installing openstackclient if keystone is not enabled"

This commit is contained in:
Zuul 2020-06-02 09:02:26 +00:00 committed by Gerrit Code Review
commit 69818cfb0c
7 changed files with 24 additions and 21 deletions

View File

@ -16,25 +16,17 @@ necessary to access Ironic. A cloud called ``bifrost`` is always available. For
example::
export OS_CLOUD=bifrost
openstack baremetal node list
baremetal node list
In noauth mode, a cloud called ``bifrost-inspector`` is also included that
allows access to the Ironic Inspector API. For example::
export OS_CLOUD=bifrost-inspector
openstack baremetal introspection list
baremetal introspection list
Environment variables
---------------------
.. note::
Previous versions of Bifrost recommended to use the ``ironic`` CLI rather
than the ``openstack`` CLI. Doing this requires setting the
``OS_AUTH_TOKEN`` environment variable, however this causes Ansible
``enroll-dynamic.yaml`` and ``deploy-dynamic.yaml`` playbooks to fail, so
``OS_AUTH_TOKEN`` should be unset before running either of these.
The following two environment variables can be set:
- ``OS_AUTH_TYPE`` - set to ``none`` to bypass authentication.
@ -46,7 +38,7 @@ to connect to a local Ironic installation operating in noauth mode. For
example::
. env-vars
openstack baremetal node list
baremetal node list
This should display a table of nodes, or nothing if there are no nodes
registered in Ironic.

View File

@ -36,11 +36,6 @@
- name: "Ensure /opt/stack is present"
file: name=/opt/stack state=directory owner=root group=root
- name: "OpenStack Client - Install"
include: pip_install.yml
package=python-openstackclient
when: skip_install is not defined
- name: "proliantutils - Install from pip"
include: pip_install.yml
package=proliantutils

View File

@ -3,6 +3,7 @@ clouds:
{% if (enable_keystone | default(false) | bool) %}
{% for cloud in clouds | default({}) | dictsort %}
{{ cloud.0 }}:
auth_type: "password"
region_name: {{ cloud.1.config_region_name }}
auth:
username: {{ cloud.1.config_username }}

View File

@ -13,7 +13,7 @@
# limitations under the License.
---
- name: Check node hardware inspection data
command: "openstack baremetal introspection data save {{ uuid }}"
command: "baremetal introspection data save {{ uuid }}"
register: inspection_data
environment:
OS_CLOUD: "{% if enable_keystone | default(false) | bool %}bifrost{% else %}bifrost-inspector{% endif %}"

View File

@ -108,12 +108,12 @@
connection: local
tasks:
- name: "List bare metal nodes using openstack client"
command: openstack baremetal node list
command: baremetal --debug node list
environment:
OS_CLOUD: bifrost
PATH: /usr/local/bin:{{ ansible_env.PATH }}
- name: "List introspection rules using openstack client"
command: openstack baremetal introspection rule list
command: baremetal --debug introspection rule list
environment:
OS_CLOUD: "{% if enable_keystone | default(false) | bool == true %}bifrost{% else %}bifrost-inspector{% endif %}"
PATH: /usr/local/bin:{{ ansible_env.PATH }}

View File

@ -0,0 +1,15 @@
---
upgrade:
- |
OpenStackClient is no longer installed when keystone is not enabled. Use
the ironic native ``baremetal`` command instead. For example, instead of
::
openstack baremetal node list
use just
::
baremetal node list

View File

@ -77,8 +77,8 @@ cp -aL /httpboot/pxelinux.cfg/ ${LOG_LOCATION}/pxe/
# Copy baremetal information
source $HOME/openrc bifrost
for vm in $(openstack baremetal node list -c Name -f value); do
openstack baremetal node show $vm >> ${LOG_LOCATION}/baremetal.txt
for vm in $(baremetal node list -c Name -f value); do
baremetal node show $vm >> ${LOG_LOCATION}/baremetal.txt
done
if [ -d "/var/log/ironic" ]; then