From e9f76042bd55ff920ff7aec039c85bd6722cf87b Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 1 Sep 2023 15:42:29 -0400 Subject: [PATCH] Allow specifying alternate channels in IPMI --- group_vars/default/base.yml | 3 +++ roles/base/templates/etc/network/interfaces.d/ipmi.j2 | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/group_vars/default/base.yml b/group_vars/default/base.yml index 859d876..d00671e 100644 --- a/group_vars/default/base.yml +++ b/group_vars/default/base.yml @@ -60,18 +60,21 @@ ipmi: address: 192.168.100.101 netmask: 255.255.255.0 gateway: 192.168.100.1 + channel: 1 # Optional: defaults to "1" if not set "pvchv2": # This name MUST match the Ansible inventory_hostname's first portion, i.e. "inventory_hostname.split('.')[0]" hostname: pvchv2-lom # A valid short name (e.g. from /etc/hosts) or an FQDN must be used here and it must resolve to address. # PVC connects to this *hostname* for fencing. address: 192.168.100.102 netmask: 255.255.255.0 gateway: 192.168.100.1 + channel: 1 # Optional: defaults to "1" if not set "pvchv3": # This name MUST match the Ansible inventory_hostname's first portion, i.e. "inventory_hostname.split('.')[0]" hostname: pvchv3-lom # A valid short name (e.g. from /etc/hosts) or an FQDN must be used here and it must resolve to address. # PVC connects to this *hostname* for fencing. address: 192.168.100.103 netmask: 255.255.255.0 gateway: 192.168.100.1 + channel: 1 # Optional: defaults to "1" if not set # IPMI user configuration # > Adjust this based on the specific hardware you are using; the cluster_hardware variable is diff --git a/roles/base/templates/etc/network/interfaces.d/ipmi.j2 b/roles/base/templates/etc/network/interfaces.d/ipmi.j2 index 1fa912e..6cd7aa5 100644 --- a/roles/base/templates/etc/network/interfaces.d/ipmi.j2 +++ b/roles/base/templates/etc/network/interfaces.d/ipmi.j2 @@ -1,5 +1,5 @@ iface ipmi inet manual - pre-up ipmitool lan set 1 ipsrc static - pre-up ipmitool lan set 1 ipaddr {{ ipmi['hosts'][this_node]['address'] }} - pre-up ipmitool lan set 1 netmask {{ ipmi['hosts'][this_node]['netmask'] }} - pre-up ipmitool lan set 1 defgw ipaddr {{ ipmi['hosts'][this_node]['gateway'] }} + pre-up ipmitool lan set {{ ipmi['hosts'][this_node]['channel']|default("1") }} ipsrc static + pre-up ipmitool lan set {{ ipmi['hosts'][this_node]['channel']|default("1") }} ipaddr {{ ipmi['hosts'][this_node]['address'] }} + pre-up ipmitool lan set {{ ipmi['hosts'][this_node]['channel']|default("1") }} netmask {{ ipmi['hosts'][this_node]['netmask'] }} + pre-up ipmitool lan set {{ ipmi['hosts'][this_node]['channel']|default("1") }} defgw ipaddr {{ ipmi['hosts'][this_node]['gateway'] }}