From bf11adba5ca87550b0edcf2fa49dd8df12a28408 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Wed, 7 Jul 2021 15:57:17 +0200 Subject: [PATCH] Allow configuring enabled vendor interfaces Change-Id: Ie1fa1836381ba7f7601259f4c888a89b6ddcd895 --- .../roles/bifrost-ironic-install/defaults/main.yml | 1 + .../roles/bifrost-ironic-install/tasks/hw_types.yml | 10 ++++++++++ .../bifrost-ironic-install/templates/ironic.conf.j2 | 1 + .../enabled_vendor_interfaces-f1b15fe75ff061fe.yaml | 8 ++++++++ 4 files changed, 20 insertions(+) create mode 100644 releasenotes/notes/enabled_vendor_interfaces-f1b15fe75ff061fe.yaml diff --git a/playbooks/roles/bifrost-ironic-install/defaults/main.yml b/playbooks/roles/bifrost-ironic-install/defaults/main.yml index 561f8d9fc..2cab99429 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/main.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/main.yml @@ -148,6 +148,7 @@ enabled_bios_interfaces: "" enabled_boot_interfaces: "" enabled_management_interfaces: "" enabled_power_interfaces: "" +enabled_vendor_interfaces: "" default_resource_class: baremetal diff --git a/playbooks/roles/bifrost-ironic-install/tasks/hw_types.yml b/playbooks/roles/bifrost-ironic-install/tasks/hw_types.yml index 2928cd6a8..dc497050d 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/hw_types.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/hw_types.yml @@ -59,3 +59,13 @@ {%- if enable_credential_less_deploy|bool -%},agent{%- endif -%} {%- if "staging-wol" in enabled_hardware_types -%},staging-wol{%- endif -%} when: not enabled_power_interfaces + +- name: "Configure vendor interfaces if required" + set_fact: + enabled_vendor_interfaces: >- + no-vendor + {%- if "idrac" in enabled_hardware_types -%},idrac-redfish{%- endif -%} + {%- 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: not enabled_vendor_interfaces diff --git a/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 b/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 index 84725be0d..97b46e281 100644 --- a/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 +++ b/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 @@ -16,6 +16,7 @@ enabled_boot_interfaces = {{ enabled_boot_interfaces }} enabled_management_interfaces = {{ enabled_management_interfaces }} enabled_power_interfaces = {{ enabled_power_interfaces }} enabled_deploy_interfaces = {{ enabled_deploy_interfaces }} +enabled_vendor_interfaces = {{ enabled_vendor_interfaces }} enabled_hardware_types = {{ enabled_hardware_types }} diff --git a/releasenotes/notes/enabled_vendor_interfaces-f1b15fe75ff061fe.yaml b/releasenotes/notes/enabled_vendor_interfaces-f1b15fe75ff061fe.yaml new file mode 100644 index 000000000..b610ba834 --- /dev/null +++ b/releasenotes/notes/enabled_vendor_interfaces-f1b15fe75ff061fe.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + Automatically configures ``enabled_vendor_interfaces`` based on the + ``enabled_hardware_types``. + - | + Adds support for manually specified enabled vendor interfaces via the new + ``enabled_vendor_interfaces`` parameter.