Get rid of the shade dependency

Shade is being phased out in favour of openstacksdk, which also allows
to simplify the authentication code.

Change-Id: I14210a720792c3f7f0669330ccb6d2f67d624246
This commit is contained in:
Dmitry Tantsur 2020-06-03 13:25:50 +02:00
parent 6cd233f8c7
commit 8b43bf00f3
23 changed files with 242 additions and 260 deletions

View File

@ -25,10 +25,10 @@ from oslo_log import log
import yaml import yaml
try: try:
import shade import openstack
SHADE_LOADED = True SDK_LOADED = True
except ImportError: except ImportError:
SHADE_LOADED = False SDK_LOADED = False
DOCUMENTATION = ''' DOCUMENTATION = '''
Bifrost Inventory Module Bifrost Inventory Module
@ -323,34 +323,16 @@ def _process_baremetal_csv(data_source, groups, hostvars):
return (groups, hostvars) return (groups, hostvars)
def _identify_shade_auth(): def _process_sdk(groups, hostvars):
"""Return shade credentials""" """Retrieve inventory utilizing OpenStackSDK."""
if os.environ.get('OS_CLOUD'): # NOTE(dtantsur): backward compatibility
return {} if os.environ.get('IRONIC_URL'):
endpoint = os.getenv( print("WARNING: IRONIC_URL is deprecated, use OS_ENDPOINT")
'OS_ENDPOINT', os.environ['OS_ENDPOINT'] = os.environ['IRONIC_URL']
os.getenv( if os.environ.get('OS_ENDPOINT') and not os.environ.get('OS_AUTH_URL'):
'OS_URL', os.getenv('IRONIC_URL', "http://localhost:6385/"))) os.environ['OS_AUTH_TYPE'] = None
options = dict(
auth_type="None",
auth=dict(endpoint=endpoint,)
)
if os.environ.get('OS_AUTH_URL'):
options['auth_type'] = "password"
options['auth'] = dict(
username=os.getenv('OS_USERNAME', ""),
password=os.getenv('OS_PASSWORD', ""),
auth_url=os.getenv('OS_AUTH_URL', ""),
project_name=os.getenv('OS_PROJECT_NAME', ""),
domain_id=os.getenv('OS_USER_DOMAIN_NAME', ""),
)
return options
cloud = openstack.connect()
def _process_shade(groups, hostvars):
"""Retrieve inventory utilizing Shade"""
options = _identify_shade_auth()
cloud = shade.operator_cloud(**options)
machines = cloud.list_machines() machines = cloud.list_machines()
node_names = os.environ.get('BIFROST_NODE_NAMES', None) node_names = os.environ.get('BIFROST_NODE_NAMES', None)
@ -432,12 +414,12 @@ def main():
"Tried JSON, YAML, and CSV formats") "Tried JSON, YAML, and CSV formats")
sys.exit(1) sys.exit(1)
elif "ironic" in data_source: elif "ironic" in data_source:
if SHADE_LOADED: if SDK_LOADED:
(groups, hostvars) = _process_shade(groups, hostvars) (groups, hostvars) = _process_sdk(groups, hostvars)
else: else:
LOG.error("BIFROST_INVENTORY_SOURCE is set to ironic " LOG.error("BIFROST_INVENTORY_SOURCE is set to ironic "
"however the shade library failed to load, and may " "however the openstacksdk library failed to load, "
"not be present.") "and may not be present.")
sys.exit(1) sys.exit(1)
else: else:
LOG.error('BIFROST_INVENTORY_SOURCE does not define a file') LOG.error('BIFROST_INVENTORY_SOURCE does not define a file')

View File

@ -21,6 +21,8 @@ Tests for `inventory` module.
from unittest import mock from unittest import mock
import openstack
from bifrost import inventory from bifrost import inventory
from bifrost.tests import base from bifrost.tests import base
@ -42,11 +44,10 @@ class TestBifrostInventoryUnit(base.TestCase):
self.assertEqual('yes', inventory._val_or_none(array, 2)) self.assertEqual('yes', inventory._val_or_none(array, 2))
self.assertIsNone(inventory._val_or_none(array, 4)) self.assertIsNone(inventory._val_or_none(array, 4))
def test__process_shade(self): @mock.patch.object(openstack, 'connect', autospec=True)
inventory.shade = mock_shade = mock.Mock() def test__process_sdk(self, mock_sdk):
inventory.SHADE_LOADED = True
(groups, hostvars) = inventory._prepare_inventory() (groups, hostvars) = inventory._prepare_inventory()
mock_cloud = mock_shade.operator_cloud.return_value mock_cloud = mock_sdk.return_value
mock_cloud.list_machines.return_value = [ mock_cloud.list_machines.return_value = [
{ {
'driver_info': { 'driver_info': {
@ -67,9 +68,7 @@ class TestBifrostInventoryUnit(base.TestCase):
'uuid': 'e2be93b5-a8f6-46a2-bec7-571b8ecf2938', 'uuid': 'e2be93b5-a8f6-46a2-bec7-571b8ecf2938',
}, },
] ]
(groups, hostvars) = inventory._process_shade(groups, hostvars) (groups, hostvars) = inventory._process_sdk(groups, hostvars)
mock_shade.operator_cloud.assert_called_once_with(
auth_type='None', auth={'endpoint': 'http://localhost:6385/'})
mock_cloud.list_machines.assert_called_once_with() mock_cloud.list_machines.assert_called_once_with()
mock_cloud.list_nics_for_machine.assert_called_once_with( mock_cloud.list_nics_for_machine.assert_called_once_with(
'f3fbf7c6-b4e9-4dd2-8ca0-c74a50f8be45') 'f3fbf7c6-b4e9-4dd2-8ca0-c74a50f8be45')
@ -95,11 +94,10 @@ class TestBifrostInventoryUnit(base.TestCase):
} }
self.assertEqual(hostvars['node1'], expected_machine) self.assertEqual(hostvars['node1'], expected_machine)
def test__process_shade_multiple_nics(self): @mock.patch.object(openstack, 'connect', autospec=True)
inventory.shade = mock_shade = mock.Mock() def test__process_sdk_multiple_nics(self, mock_sdk):
inventory.SHADE_LOADED = True
(groups, hostvars) = inventory._prepare_inventory() (groups, hostvars) = inventory._prepare_inventory()
mock_cloud = mock_shade.operator_cloud.return_value mock_cloud = mock_sdk.return_value
mock_cloud.list_machines.return_value = [ mock_cloud.list_machines.return_value = [
{ {
'driver_info': { 'driver_info': {
@ -124,9 +122,7 @@ class TestBifrostInventoryUnit(base.TestCase):
'uuid': '59e8cd37-4f71-4ca1-a264-93c2ca7de0f7', 'uuid': '59e8cd37-4f71-4ca1-a264-93c2ca7de0f7',
}, },
] ]
(groups, hostvars) = inventory._process_shade(groups, hostvars) (groups, hostvars) = inventory._process_sdk(groups, hostvars)
mock_shade.operator_cloud.assert_called_once_with(
auth_type='None', auth={'endpoint': 'http://localhost:6385/'})
mock_cloud.list_machines.assert_called_once_with() mock_cloud.list_machines.assert_called_once_with()
mock_cloud.list_nics_for_machine.assert_called_once_with( mock_cloud.list_nics_for_machine.assert_called_once_with(
'f3fbf7c6-b4e9-4dd2-8ca0-c74a50f8be45') 'f3fbf7c6-b4e9-4dd2-8ca0-c74a50f8be45')

View File

@ -48,7 +48,6 @@ this.
cirros_deploy_image_upstream_url: file:///vagrant/cirros-0.4.0-x86_64-disk.img cirros_deploy_image_upstream_url: file:///vagrant/cirros-0.4.0-x86_64-disk.img
dib_git_url: file:///vagrant/git/diskimage-builder dib_git_url: file:///vagrant/git/diskimage-builder
ironicclient_git_url: file:///vagrant/git/python-ironicclient ironicclient_git_url: file:///vagrant/git/python-ironicclient
shade_git_url: file:///vagrant/git/shade
ironic_git_url: file:///vagrant/git/ironic ironic_git_url: file:///vagrant/git/ironic
If this list becomes out of date, it's simple enough to find the things that If this list becomes out of date, it's simple enough to find the things that

View File

@ -46,12 +46,9 @@ registered in Ironic.
Enroll Hardware Enroll Hardware
=============== ===============
The following requirements are installed during the install process The openstacksdk library is installed during the install process
as documented in the install documentation. as documented in the install documentation.
- openstack/shade library
- openstack/os-client-config
In order to enroll hardware, you will naturally need an inventory of In order to enroll hardware, you will naturally need an inventory of
your hardware. When utilizing the dynamic inventory module and your hardware. When utilizing the dynamic inventory module and
accompanying roles the inventory can be supplied in one of three ways, accompanying roles the inventory can be supplied in one of three ways,

View File

@ -24,6 +24,7 @@ mox3==0.25.0
msgpack==0.5.6 msgpack==0.5.6
netaddr==0.7.19 netaddr==0.7.19
netifaces==0.10.6 netifaces==0.10.6
openstacksdk==0.37.0
os-client-config==1.29.0 os-client-config==1.29.0
oslo.config==5.2.0 oslo.config==5.2.0
oslo.context==2.20.0 oslo.context==2.20.0

View File

@ -11,10 +11,10 @@
# other operating systems or if your target node has multiple ethernet # other operating systems or if your target node has multiple ethernet
# interfaces. # interfaces.
# #
# NOTE(TheJulia): A user could utilize the os_ironic_facts module with another # NOTE(TheJulia): A user could utilize the os_ironic_node_info module with
# data source such as a CSV, YAML, or JSON file formats to query ironic, and # another data source such as a CSV, YAML, or JSON file formats to query
# the example role conditionals below to query current status and deploy to # ironic, and the example role conditionals below to query current status and
# nodes. # deploy to nodes.
--- ---
- hosts: localhost - hosts: localhost
connection: local connection: local

View File

@ -1,147 +0,0 @@
#!/usr/bin/env python
# coding: utf-8 -*-
# (c) 2015, Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
try:
import shade
HAS_SHADE = True
except ImportError:
HAS_SHADE = False
DOCUMENTATION = '''
---
module: os_ironic_facts
short_description: Searches Ironic and returns node facts.
extends_documentation_fragment: openstack
description:
- Queries Ironic for a requested node and returns facts about
the node, or fails if the node is not found. This module actively
prevents any passwords in the node driver_info from being returned.
options:
mac:
description:
- unique mac address that is used to attempt to identify the host.
required: false
default: None
uuid:
description:
- globally unique identifier (UUID) to identify the host.
required: false
default: None
name:
description:
- unique name identifier to identify the host in Ironic.
required: false
default: None
ironic_url:
description:
- If noauth mode is utilized, this is required to be set to the
endpoint URL for the Ironic API. Use with "auth" and "auth_type"
settings set to None.
required: false
default: None
requirements: ["shade", "six"]
'''
EXAMPLES = '''
# Enroll a node with some basic properties and driver info
- os_ironic_facts:
name: "testvm1"
'''
def _choose_id_value(module):
if module.params['uuid']:
return module.params['uuid']
if module.params['name']:
return module.params['name']
return None
def main():
argument_spec = openstack_full_argument_spec( # noqa: F405
auth_type=dict(required=False),
uuid=dict(required=False),
name=dict(required=False),
mac=dict(required=False),
ironic_url=dict(required=False),
skip_items=dict(required=False, type='list'),
)
module_kwargs = openstack_module_kwargs() # noqa: F405
module = AnsibleModule(argument_spec, **module_kwargs) # noqa: F405
if not HAS_SHADE:
module.fail_json(msg='shade is required for this module')
if (module.params['auth_type'] in [None, 'None'] and
module.params['ironic_url'] is None):
module.fail_json(msg="Authentication appears to be disabled, "
"Please define an ironic_url parameter")
if (module.params['ironic_url'] and
module.params['auth_type'] in [None, 'None']):
module.params['auth'] = dict(
endpoint=module.params['ironic_url']
)
try:
cloud = shade.operator_cloud(**module.params)
if module.params['name'] or module.params['uuid']:
server = cloud.get_machine(_choose_id_value(module))
elif module.params['mac']:
server = cloud.get_machine_by_mac(module.params['mac'])
else:
module.fail_json(msg="The worlds did not align, "
"the host was not found as "
"no name, uuid, or mac was "
"defined.")
if server:
facts = dict(server)
new_driver_info = dict()
# Rebuild driver_info to remove any password values
# as they will be masked.
for key, value in facts['driver_info'].items():
if 'password' not in key:
new_driver_info[key] = value
if new_driver_info:
facts['driver_info'] = new_driver_info
for item in module.params['skip_items']:
if item in facts:
del facts[item]
# Remove ports and links as they are useless in the ansible
# use context.
if "ports" in facts:
del facts["ports"]
if "links" in facts:
del facts["links"]
module.exit_json(changed=False, ansible_facts=facts)
else:
module.fail_json(msg="node not found.")
except shade.OpenStackCloudException as e:
module.fail_json(msg=e.message)
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * # noqa: E402
from ansible.module_utils.openstack import * # noqa: E402
main()

View File

@ -0,0 +1 @@
os_ironic_node_info.py

View File

@ -0,0 +1,178 @@
#!/usr/bin/env python
# coding: utf-8 -*-
# (c) 2015, Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
try:
import openstack
HAS_SDK = True
except ImportError:
HAS_SDK = False
DOCUMENTATION = '''
---
module: os_ironic_node_info
short_description: Searches Ironic and returns node information.
extends_documentation_fragment: openstack
description:
- Queries Ironic for a requested node and returns "node" variable with
information about the node, or fails if the node is not found. This
module actively prevents any passwords in the node driver_info from being
returned.
options:
mac:
description:
- unique mac address that is used to attempt to identify the host.
required: false
default: None
uuid:
description:
- globally unique identifier (UUID) to identify the host.
required: false
default: None
name:
description:
- unique name identifier to identify the host in Ironic.
required: false
default: None
ironic_url:
description:
- If noauth mode is utilized, this is required to be set to the
endpoint URL for the Ironic API. Use with "auth" and "auth_type"
settings set to None.
required: false
default: None
requirements: ["openstacksdk"]
'''
EXAMPLES = '''
# Get information about the node called "testvm1" and store in "node_info.node"
- os_ironic_node_info:
name: "testvm1"
register: node_info
'''
def _choose_id_value(module):
if module.params['uuid']:
return module.params['uuid']
if module.params['name']:
return module.params['name']
return None
def main():
argument_spec = openstack_full_argument_spec( # noqa: F405
auth_type=dict(required=False),
uuid=dict(required=False),
name=dict(required=False),
mac=dict(required=False),
ironic_url=dict(required=False),
skip_items=dict(required=False, type='list'),
)
module_kwargs = openstack_module_kwargs() # noqa: F405
module = AnsibleModule(argument_spec, **module_kwargs) # noqa: F405
compat = module._name == 'os_ironic_facts'
if compat:
module.deprecate('Using os_ironic_node_info via os_ironic_facts is '
'deprecated and may not work correctly')
if not HAS_SDK:
module.fail_json(msg='openstacksdk is required for this module')
if (module.params['ironic_url'] and
module.params['auth_type'] in [None, 'None', 'none']):
module.params['auth'] = dict(
endpoint=module.params['ironic_url']
)
# NOTE(dtantsur): the following part is copied more or less verbatim from
# ansible-collections-openstack.
cloud_config = module.params.pop('cloud', None)
try:
if isinstance(cloud_config, dict):
fail_message = (
"A cloud config dict was provided to the cloud parameter"
" but also a value was provided for {param}. If a cloud"
" config dict is provided, {param} should be"
" excluded.")
for param in ('auth', 'auth_type'):
if module.params[param] is not None:
module.fail_json(msg=fail_message.format(param=param))
cloud = openstack.connect(**cloud_config)
else:
cloud = openstack.connect(
cloud=cloud_config,
auth_type=module.params['auth_type'],
auth=module.params['auth'],
)
if module.params['name'] or module.params['uuid']:
server = cloud.get_machine(_choose_id_value(module))
elif module.params['mac']:
server = cloud.get_machine_by_mac(module.params['mac'])
else:
module.fail_json(msg="The worlds did not align, "
"the host was not found as "
"no name, uuid, or mac was "
"defined.")
if server:
facts = dict(server)
new_driver_info = dict()
# Rebuild driver_info to remove any password values
# as they will be masked.
for key, value in facts['driver_info'].items():
if 'password' not in key:
new_driver_info[key] = value
if new_driver_info:
facts['driver_info'] = new_driver_info
for item in module.params['skip_items']:
if item in facts:
del facts[item]
# Remove ports and links as they are useless in the ansible
# use context.
if "ports" in facts:
del facts["ports"]
if "links" in facts:
del facts["links"]
nics = cloud.list_nics_for_machine(server['uuid'])
facts['nics'] = [{'mac': nic['address']} for nic in nics]
if compat:
# NOTE(dtantsur): this item conflicts with the ansible's own
# network_interface breaking everything.
facts.pop('network_interface', None)
if compat:
module.exit_json(changed=False, ansible_facts=facts)
else:
module.exit_json(changed=False, node=facts)
else:
module.fail_json(msg="node not found.")
except openstack.exceptions.SDKException as e:
module.fail_json(msg=e.message)
# this is magic, see lib/ansible/module_common.py
from ansible.module_utils.basic import * # noqa: E402
from ansible.module_utils.openstack import * # noqa: E402
main()

View File

@ -30,26 +30,27 @@
connection: local connection: local
pre_tasks: pre_tasks:
- name: "Pull initial ironic facts" - name: "Pull initial ironic facts"
os_ironic_facts: os_ironic_node_info:
auth_type: "{{ auth_type | default(omit) }}" auth_type: "{{ auth_type | default(omit) }}"
auth: "{{ auth | default(omit) }}" auth: "{{ auth | default(omit) }}"
name: "{{ inventory_hostname }}" name: "{{ inventory_hostname }}"
ironic_url: "{{ ironic_url }}" ironic_url: "{{ ironic_url }}"
skip_items: [] skip_items: []
register: node_info
roles: roles:
- { role: bifrost-unprovision-node-dynamic, when: (provision_state == "active" - { role: bifrost-unprovision-node-dynamic, when: (provision_state == "active"
or provision_state == "deploy failed" or provision_state == "deploy failed"
or provision_state == "error") and maintenance | bool != true } or provision_state == "error") and maintenance | bool != true }
post_tasks: post_tasks:
- name: "Pull ironic facts until provision state available" - name: "Pull ironic facts until provision state available"
os_ironic_facts: os_ironic_node_info:
auth_type: "{{ auth_type | default(omit) }}" auth_type: "{{ auth_type | default(omit) }}"
auth: "{{ auth | default(omit) }}" auth: "{{ auth | default(omit) }}"
name: "{{ inventory_hostname }}" name: "{{ inventory_hostname }}"
ironic_url: "{{ ironic_url }}" ironic_url: "{{ ironic_url }}"
skip_items: [] skip_items: []
register: result register: node_info
until: provision_state == "available" until: node_info.node.provision_state == "available"
retries: "{{ available_state_wait_retries | default(15) }}" retries: "{{ available_state_wait_retries | default(15) }}"
delay: "{{ provision_state_retry_interval | default(20) }}" delay: "{{ provision_state_retry_interval | default(20) }}"
- hosts: baremetal - hosts: baremetal
@ -61,14 +62,14 @@
- { role: bifrost-deploy-nodes-dynamic, when: provision_state == "available" and maintenance | bool != true } - { role: bifrost-deploy-nodes-dynamic, when: provision_state == "available" and maintenance | bool != true }
post_tasks: post_tasks:
- name: "Pull ironic facts until provision state active" - name: "Pull ironic facts until provision state active"
os_ironic_facts: os_ironic_node_info:
auth_type: "{{ auth_type | default(omit) }}" auth_type: "{{ auth_type | default(omit) }}"
auth: "{{ auth | default(omit) }}" auth: "{{ auth | default(omit) }}"
name: "{{ inventory_hostname }}" name: "{{ inventory_hostname }}"
ironic_url: "{{ ironic_url }}" ironic_url: "{{ ironic_url }}"
skip_items: [] skip_items: []
register: result register: node_info
until: provision_state == "active" until: node_info.node.provision_state == "active"
retries: "{{ active_state_wait_retries | default(30) }}" retries: "{{ active_state_wait_retries | default(30) }}"
delay: "{{ provision_state_retry_interval | default(20) }}" delay: "{{ provision_state_retry_interval | default(20) }}"

View File

@ -46,7 +46,7 @@
ipv4_subnet_mask: "{{ ipv4_subnet_mask | default('') }}" ipv4_subnet_mask: "{{ ipv4_subnet_mask | default('') }}"
vlan_id: "{{ vlan_id | default('') }}" vlan_id: "{{ vlan_id | default('') }}"
network_mtu: "{{ network_mtu | default('1500') }}" network_mtu: "{{ network_mtu | default('1500') }}"
nics: "{{ nics | default(omit) }}" nics: "{{ node_info.node.nics | default(omit) }}"
node_network_data: "{{ node_network_data | default(node_network_info) }}" node_network_data: "{{ node_network_data | default(node_network_info) }}"
when: addressing_mode is undefined or "dhcp" not in addressing_mode when: addressing_mode is undefined or "dhcp" not in addressing_mode

View File

@ -37,7 +37,7 @@
# ironic knows, that we do not know potentially, such as an UUID # ironic knows, that we do not know potentially, such as an UUID
# should a node have been created without one. # should a node have been created without one.
- name: "Collecting node facts" - name: "Collecting node facts"
os_ironic_facts: os_ironic_node_info:
cloud: "{{ cloud_name | default(omit) }}" cloud: "{{ cloud_name | default(omit) }}"
auth_type: "{{ auth_type }}" auth_type: "{{ auth_type }}"
auth: "{{ auth }}" auth: "{{ auth }}"
@ -46,3 +46,4 @@
name: "{{ name | default() }}" name: "{{ name | default() }}"
skip_items: skip_items:
- instance_info - instance_info
register: node_info

View File

@ -35,12 +35,11 @@ should be enabled.
cleaning: false cleaning: false
The ironic python client and shade libraries can be installed directly from The ironic python client and openstacksdk libraries can be installed directly
Git. The default is to utilize pip to install the current versions in pypi, from Git. The default is to utilize pip to install the current versions in pypi,
however testing may require master branch or custom patches. however testing may require master branch or custom patches.
openstacksdk_source_install: true openstacksdk_source_install: true
shade_source_install: true
Bifrost requires access to the network where nodes are located, in order to Bifrost requires access to the network where nodes are located, in order to
provision the nodes. By default, this setting is set to a value for local provision the nodes. By default, this setting is set to a value for local

View File

@ -13,7 +13,6 @@ staging_drivers_include: false
file_url_port: "8080" file_url_port: "8080"
ironicclient_source_install: false ironicclient_source_install: false
openstacksdk_source_install: true openstacksdk_source_install: true
shade_source_install: true
ironicinspector_source_install: true ironicinspector_source_install: true
ironicinspectorclient_source_install: false ironicinspectorclient_source_install: false
sushy_source_install: false sushy_source_install: false
@ -83,7 +82,6 @@ include_dhcp_server: true
dib_git_url: https://opendev.org/openstack/diskimage-builder dib_git_url: https://opendev.org/openstack/diskimage-builder
ironicclient_git_url: https://opendev.org/openstack/python-ironicclient ironicclient_git_url: https://opendev.org/openstack/python-ironicclient
openstacksdk_git_url: https://opendev.org/openstack/openstacksdk openstacksdk_git_url: https://opendev.org/openstack/openstacksdk
shade_git_url: https://opendev.org/openstack/shade
ironic_git_url: https://opendev.org/openstack/ironic ironic_git_url: https://opendev.org/openstack/ironic
staging_drivers_git_url: https://opendev.org/x/ironic-staging-drivers staging_drivers_git_url: https://opendev.org/x/ironic-staging-drivers
ironicinspector_git_url: https://opendev.org/openstack/ironic-inspector ironicinspector_git_url: https://opendev.org/openstack/ironic-inspector
@ -101,7 +99,6 @@ disable_dnsmasq_dns: False
ironic_git_folder: /opt/stack/ironic ironic_git_folder: /opt/stack/ironic
ironicclient_git_folder: /opt/stack/python-ironicclient ironicclient_git_folder: /opt/stack/python-ironicclient
openstacksdk_git_folder: /opt/stack/openstacksdk openstacksdk_git_folder: /opt/stack/openstacksdk
shade_git_folder: /opt/stack/shade
dib_git_folder: /opt/stack/diskimage-builder dib_git_folder: /opt/stack/diskimage-builder
reqs_git_folder: /opt/stack/requirements reqs_git_folder: /opt/stack/requirements
upper_constraints_file: "{{ lookup('env', 'UPPER_CONSTRAINTS_FILE') | default(reqs_git_folder + '/upper-constraints.txt', True) }}" upper_constraints_file: "{{ lookup('env', 'UPPER_CONSTRAINTS_FILE') | default(reqs_git_folder + '/upper-constraints.txt', True) }}"

View File

@ -26,7 +26,7 @@
- name: "If running in CI, set source install facts just to be sure" - name: "If running in CI, set source install facts just to be sure"
set_fact: set_fact:
shade_source_install: true openstacksdk_source_install: true
ironicclient_source_install: true ironicclient_source_install: true
when: ci_testing | bool == true when: ci_testing | bool == true
@ -123,19 +123,9 @@
include: staging_install.yml include: staging_install.yml
when: skip_install is not defined and staging_drivers_include | bool == true when: skip_install is not defined and staging_drivers_include | bool == true
# NOTE(pas-ha) even when install into virtualenv is requested, - name: install openstacksdk
# we need to install shade into system for enroll-dynamic to succeed include: pip_install.yml
- block: package=openstacksdk
- name: install shade sourcedir={{ openstacksdk_git_folder }}
include: pip_install.yml source_install={{ openstacksdk_source_install }}
package=shade
sourcedir={{ shade_git_folder }}
source_install={{ shade_source_install }}
# NOTE(TheJulia): Install openstacksdk since shade wraps to openstacksdk and
# the logic is largely going into openstacksdk as time goes on.
- name: install openstacksdk
include: pip_install.yml
package=openstacksdk
sourcedir={{ openstacksdk_git_folder }}
source_install={{ openstacksdk_source_install }}
when: skip_install is not defined when: skip_install is not defined

View File

@ -24,8 +24,6 @@ ironic_git_folder: The folder where the ironic codebase has been cloned to.
ironicclient_git_folder: The folder where the python-ironicclient code base ironicclient_git_folder: The folder where the python-ironicclient code base
has been cloned to. has been cloned to.
shade_git_folder: The folder where the shade code base has been cloned to.
Dependencies Dependencies
------------ ------------
@ -53,7 +51,6 @@ of the logic to properly handle an OpenStack CI environment node.
ci_testing_zuul: true ci_testing_zuul: true
ironic_git_url: /opt/git/openstack/ironic ironic_git_url: /opt/git/openstack/ironic
ironicclient_git_url: /opt/git/openstack/python-ironicclient ironicclient_git_url: /opt/git/openstack/python-ironicclient
shade_git_url: /opt/git/openstack/shade
when: lookup('env', 'ZUUL_BRANCH') != "" when: lookup('env', 'ZUUL_BRANCH') != ""
roles: roles:
- { role: bifrost-prep-for-install, when: skip_install is not defined } - { role: bifrost-prep-for-install, when: skip_install is not defined }

View File

@ -28,9 +28,6 @@ ironicclient_git_url: URL for ironicclient, defaults to:
openstacksdk_git_url: URL for openstacksdk, defaults to: openstacksdk_git_url: URL for openstacksdk, defaults to:
https://opendev.org/openstack/openstacksdk https://opendev.org/openstack/openstacksdk
shade_git_url: URL for shade, defaults to:
https://opendev.org/openstack/shade
ironic_git_url: URL for ironic, defaults to: ironic_git_url: URL for ironic, defaults to:
https://opendev.org/openstack/ironic https://opendev.org/openstack/ironic
@ -46,9 +43,6 @@ ironic_git_folder: The folder to clone ironic to if missing, default to:
openstacksdk_git_folder: The folder to clone openstacksdk to if missing, openstacksdk_git_folder: The folder to clone openstacksdk to if missing,
defaults to: "{{ git_root}}/openstacksdk.git" defaults to: "{{ git_root}}/openstacksdk.git"
shade_git_folder: The folder to clone shade to if missing, defaults to:
"{{ git_root}}/shade.git"
sushy_git_folder: The folder to clone sushy to if missing, default to: sushy_git_folder: The folder to clone sushy to if missing, default to:
"{{ git_root}}/sushy.git" "{{ git_root}}/sushy.git"
@ -62,8 +56,6 @@ ironic_git_branch: Branch to install, defaults to the value of git_branch.
openstacksdk_git_branch: Branch to install, defaults to the value of openstacksdk_git_branch: Branch to install, defaults to the value of
git_branch. git_branch.
shade_git_branch: Branch to install, defaults to the value of git_branch.
dib_git_branch: Branch to install, defaults to "master". dib_git_branch: Branch to install, defaults to "master".
ironicinspector_git_branch: Branch to install, defaults to the value of ironicinspector_git_branch: Branch to install, defaults to the value of

View File

@ -5,7 +5,6 @@ git_root: "/opt/stack"
dib_git_url: https://opendev.org/openstack/diskimage-builder dib_git_url: https://opendev.org/openstack/diskimage-builder
ironicclient_git_url: https://opendev.org/openstack/python-ironicclient ironicclient_git_url: https://opendev.org/openstack/python-ironicclient
openstacksdk_git_url: https://opendev.org/openstack/openstacksdk openstacksdk_git_url: https://opendev.org/openstack/openstacksdk
shade_git_url: https://opendev.org/openstack/shade
ironic_git_url: https://opendev.org/openstack/ironic ironic_git_url: https://opendev.org/openstack/ironic
ironicinspector_git_url: https://opendev.org/openstack/ironic-inspector ironicinspector_git_url: https://opendev.org/openstack/ironic-inspector
ironicinspectorclient_git_url: https://opendev.org/openstack/python-ironic-inspector-client ironicinspectorclient_git_url: https://opendev.org/openstack/python-ironic-inspector-client
@ -21,7 +20,6 @@ ironic_git_folder: "{{ git_root}}/ironic"
ironicinspector_git_folder: "{{ git_root}}/ironic-inspector" ironicinspector_git_folder: "{{ git_root}}/ironic-inspector"
ironicinspectorclient_git_folder: "{{ git_root}}/python-ironic-inspector-client" ironicinspectorclient_git_folder: "{{ git_root}}/python-ironic-inspector-client"
openstacksdk_git_folder: "{{ git_root}}/openstacksdk" openstacksdk_git_folder: "{{ git_root}}/openstacksdk"
shade_git_folder: "{{ git_root}}/shade"
dib_git_folder: "{{ git_root }}/diskimage-builder" dib_git_folder: "{{ git_root }}/diskimage-builder"
reqs_git_folder: "{{ git_root }}/requirements" reqs_git_folder: "{{ git_root }}/requirements"
upper_constraints_file: "{{ lookup('env', 'UPPER_CONSTRAINTS_FILE') | default(reqs_git_folder + '/upper-constraints.txt', True) }}" upper_constraints_file: "{{ lookup('env', 'UPPER_CONSTRAINTS_FILE') | default(reqs_git_folder + '/upper-constraints.txt', True) }}"
@ -35,7 +33,6 @@ git_branch: master
ironicclient_git_branch: "{{ git_branch }}" ironicclient_git_branch: "{{ git_branch }}"
ironic_git_branch: "{{ git_branch }}" ironic_git_branch: "{{ git_branch }}"
openstacksdk_git_branch: "{{ git_branch }}" openstacksdk_git_branch: "{{ git_branch }}"
shade_git_branch: "{{ git_branch }}"
dib_git_branch: master dib_git_branch: master
ironicinspector_git_branch: "{{ git_branch }}" ironicinspector_git_branch: "{{ git_branch }}"
ironicinspectorclient_git_branch: "{{ git_branch }}" ironicinspectorclient_git_branch: "{{ git_branch }}"
@ -63,10 +60,6 @@ bifrost_install_sources:
git_url: "{{ openstacksdk_git_url }}" git_url: "{{ openstacksdk_git_url }}"
git_branch: "{{ openstacksdk_git_branch }}" git_branch: "{{ openstacksdk_git_branch }}"
name: openstacksdk name: openstacksdk
- git_folder: "{{ shade_git_folder }}"
git_url: "{{ shade_git_url }}"
git_branch: "{{ shade_git_branch }}"
name: shade
- git_folder: "{{ dib_git_folder }}" - git_folder: "{{ dib_git_folder }}"
git_url: "{{ dib_git_url }}" git_url: "{{ dib_git_url }}"
git_branch: "{{ dib_git_branch }}" git_branch: "{{ dib_git_branch }}"

View File

@ -8,9 +8,7 @@ Requirements
------------ ------------
This role is dependent upon the os-ironic ansible module, which is dependent This role is dependent upon the os-ironic ansible module, which is dependent
upon shade (https://opendev.org/openstack/shade/), which in upon openstacksdk (https://opendev.org/openstack/openstacksdk/).
this case is presently dependent upon the Ironic Python Client Library
(https://opendev.org/openstack/python-ironicclient/).
Role Variables Role Variables
-------------- --------------

View File

@ -29,8 +29,8 @@ cloud_name: Optional: String value defining a clouds.yaml entry for
the ansible module to leverage. the ansible module to leverage.
inspection_wait_timeout: Integer value in seconds, defaults to 1800. inspection_wait_timeout: Integer value in seconds, defaults to 1800.
This value may need to be adjusted if the underlying This value may need to be adjusted if the underlying
shade library's default timeout is insufficient for openstacksdk library's default timeout is insufficient
a node to perform an inspection sequence with. for a node to perform an inspection sequence with.
The timeout assumption in the library was The timeout assumption in the library was
based upon there being three phases to complete based upon there being three phases to complete
an inspection sequence, BIOS POST, (i)PXE, an inspection sequence, BIOS POST, (i)PXE,

View File

@ -32,7 +32,6 @@
ironic_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/ironic" ironic_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/ironic"
ironicclient_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/python-ironicclient" ironicclient_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/python-ironicclient"
openstacksdk_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/openstacksdk" openstacksdk_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/openstacksdk"
shade_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/shade"
dib_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/diskimage-builder" dib_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/diskimage-builder"
ironicinspector_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/ironic-inspector" ironicinspector_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/ironic-inspector"
ironicinspectorclient_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/python-ironic-inspector-client" ironicinspectorclient_git_url: "{{ lookup('env', 'WORKSPACE') }}/openstack/python-ironic-inspector-client"

View File

@ -0,0 +1,8 @@
---
upgrade:
- |
The shade library is no longer used, nor installed by default.
deprecations:
- |
The ``os_ironic_facts`` module is deprecated. Please use
``os_ironic_node_info`` that returns information in the "node" parameter.

View File

@ -15,3 +15,4 @@ PyYAML>=3.12 # MIT
Pygments>=2.2.0 # BSD license Pygments>=2.2.0 # BSD license
flake8-import-order>=0.17.1 # LGPLv3 flake8-import-order>=0.17.1 # LGPLv3
openstacksdk>=0.37.0 # Apache-2.0

View File

@ -26,7 +26,6 @@
- openstack/python-ironic-inspector-client - openstack/python-ironic-inspector-client
- openstack/python-ironicclient - openstack/python-ironicclient
- openstack/requirements - openstack/requirements
- openstack/shade
- openstack/sushy - openstack/sushy
- x/ironic-staging-drivers - x/ironic-staging-drivers