From f3cc81fc5508fc384befa0809626b37c50a9e9a7 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Wed, 19 Dec 2018 14:02:26 +0000 Subject: [PATCH] Support legacy drivers Adds support for pxe_ipmitool, pxe_ipmitool_socat, agent_ipmitool and agent_ipmitool_socat drivers with virtualbmc. Also adds entries for SNMP-based drivers. Change-Id: I461e74e3199e02a35ee0d3ddc1f6e49c1eda0536 --- ansible/host_vars/localhost | 12 +++++++++--- ansible/node_bmc.yml | 14 +++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ansible/host_vars/localhost b/ansible/host_vars/localhost index 0803e20..e9305ff 100644 --- a/ansible/host_vars/localhost +++ b/ansible/host_vars/localhost @@ -105,7 +105,13 @@ state_file_path: >- # The default Ironic driver of a node. Can be overridden per-node. default_ironic_driver: ipmi -# Maps BMC emulation tools to the Ironic driver they support. +# Maps Ironic drivers to the BMC emulation tool they support. bmc_emulators: - virtualbmc: ipmi - sushy-tools: redfish + agent_ipmitool: virtualbmc + agent_ipmitool_socat: virtualbmc + ipmi: virtualbmc + pxe_ipmitool: virtualbmc + pxe_ipmitool_socat: virtualbmc + pxe_snmp: virtualpdu + redfish: sushy-tools + snmp: virtualpdu diff --git a/ansible/node_bmc.yml b/ansible/node_bmc.yml index c91e33f..ead201a 100644 --- a/ansible/node_bmc.yml +++ b/ansible/node_bmc.yml @@ -9,10 +9,18 @@ - name: Perform Virtual BMC configuration hosts: libvirt vars: + # List of ironic drivers that require virtualbmc. + vbmc_drivers: >- + {{ bmc_emulators.items() | + selectattr('1', 'eq', 'virtualbmc') | + map(attribute='0') | + list }} + # List of ironic nodes using drivers that require virtualbmc. vbmc_nodes: >- - {{ hostvars.localhost.tenks_state[inventory_hostname].nodes - | default([]) | selectattr('ironic_driver', 'eq', - bmc_emulators.virtualbmc) | list }} + {{ hostvars.localhost.tenks_state[inventory_hostname].nodes | + default([]) | + selectattr('ironic_driver', 'in', vbmc_drivers) | + list }} tasks: - name: Check that enough ports are available for Virtual BMC fail: