Derive enabled hardware interfaces from enabled_hardware_types

This greatly simplifies initial configuration. The simple CLI
now defaults to the community hardware types.

Change-Id: If4bee8ee3e3349742e360fd44f1f5f93b4913aed
This commit is contained in:
Dmitry Tantsur 2020-06-22 14:51:21 +02:00
parent e4b32c2348
commit f5906a9aff
6 changed files with 68 additions and 8 deletions

View File

@ -144,6 +144,7 @@ def cmd_install(args):
enable_keystone=args.enable_keystone,
use_public_urls=args.enable_keystone,
noauth_mode=not args.enable_keystone,
enabled_hardware_types=args.hardware_types,
testing=args.testenv,
use_cirros=args.testenv,
use_tinyipa=args.testenv,
@ -198,6 +199,11 @@ def parse_args():
help='the network interface to use')
install.add_argument('--enable-keystone', action='store_true',
help='enable keystone and use authentication')
install.add_argument('--hardware-types',
# only generic types are enabled in the simple CI
default='ipmi,redfish,manual-management',
help='a comma separated list of enabled bare metal '
'hardware types')
args = parser.parse_args()
if getattr(args, 'func', None) is None:

View File

@ -86,9 +86,10 @@ extra_kernel_options: Default undefined.
Hardware types can be enabled using the "enabled_hardware_types" variable,
which defaults to "ipmi, ilo".
Enabled interfaces can be set via the "enabled_boot_interfaces",
"enabled_deploy_interfaces", "enabled_management_interfaces", and
"enabled_power_interfaces" variables.
Enabled interfaces can be set via the "enabled_bios_interfaces",
"enabled_boot_interfaces", "enabled_deploy_interfaces",
"enabled_management_interfaces", and "enabled_power_interfaces" variables.
By default they are derived from "enabled_hardware_types".
In the event of an external DHCP server being used, the user will need to
configure their DHCP server such that PXE, and iPXE chain loading occurs.

View File

@ -127,12 +127,12 @@ ipa_builder_git_folder: /opt/stack/ironic-python-agent-builder
enabled_hardware_types: "ipmi,redfish,manual-management,ilo"
default_deploy_interface: "direct"
enabled_bios_interfaces: "redfish,ilo,no-bios"
enabled_boot_interfaces: "ilo-virtual-media,ipxe,pxe"
enabled_deploy_interfaces: "iscsi,direct"
enabled_management_interfaces: "redfish,ilo,ipmitool,noop"
enabled_power_interfaces: "redfish,ilo,ipmitool,fake"
# These are calculated based on enabled_hardware_types if empty
enabled_bios_interfaces: ""
enabled_boot_interfaces: ""
enabled_management_interfaces: ""
enabled_power_interfaces: ""
default_resource_class: baremetal

View File

@ -0,0 +1,45 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
- name: "Configure BIOS interfaces if required"
set_fact:
enabled_bios_interfaces: >-
no-bios
{%- if "ilo" in enabled_hardware_types -%},ilo{%- endif -%}
{%- if "redfish" in enabled_hardware_types -%},redfish{%- endif -%}
when: enabled_bios_interfaces == ""
- name: "Configure boot interfaces if required"
set_fact:
enabled_boot_interfaces: >-
ipxe,pxe
{%- if "ilo" in enabled_hardware_types -%},ilo-virtual-media{%- endif -%}
when: enabled_boot_interfaces == ""
- name: "Configure management interfaces if required"
set_fact:
enabled_management_interfaces: >-
noop
{%- if "ilo" in enabled_hardware_types -%},ilo{%- endif -%}
{%- if "ipmi" in enabled_hardware_types -%},ipmitool{%- endif -%}
{%- if "redfish" in enabled_hardware_types -%},redfish{%- endif -%}
when: enabled_management_interfaces == ""
- name: "Configure power interfaces if required"
set_fact:
enabled_power_interfaces: >-
fake
{%- if "ilo" in enabled_hardware_types -%},ilo{%- endif -%}
{%- if "ipmi" in enabled_hardware_types -%},ipmitool{%- endif -%}
{%- if "redfish" in enabled_hardware_types -%},redfish{%- endif -%}
when: enabled_power_interfaces == ""

View File

@ -28,6 +28,8 @@
The configured network interface {{ network_interface }} does
not have an IP address assigned
when: not hostvars[inventory_hostname][provisioning_itf_name].get('ipv4', {}).get('address')
- name: "Configure hardware interfaces"
import_tasks: hw_types.yml
- name: "Create ironic config"
template:
src="ironic.conf.j2"

View File

@ -0,0 +1,6 @@
---
features:
- |
The values of ``enabled_bios_interfaces``, ``enabled_boot_interfaces``,
``enabled_management_interfaces`` and ``enabled_power_interfaces`` are now
derived from the ``enabled_hardware_types`` if left empty (the default).