Update templates for IPMI

This commit is contained in:
Gregory Kurtzer
2020-12-01 18:24:31 -08:00
parent 581bc929e0
commit eb19627e13
2 changed files with 17 additions and 11 deletions

View File

@@ -19,11 +19,15 @@ import (
type TemplateStruct struct {
Self struct {
Fqdn string
Hostname string
GroupName string
Vnfs string
NetDevs map[string]*node.NetDevs
Fqdn string
Hostname string
GroupName string
Vnfs string
IpmiIpaddr string
IpmiNetmask string
IpmiUserName string
IpmiPassword string
NetDevs map[string]*node.NetDevs
}
AllNodes []node.NodeInfo
}
@@ -134,6 +138,10 @@ func buildOverlay(nodeList []node.NodeInfo, overlayType string) error {
t.Self.Hostname = node.HostName.Get()
t.Self.GroupName = node.Gid.Get()
t.Self.Vnfs = node.Vnfs.Get()
t.Self.IpmiIpaddr = node.IpmiIpaddr.Get()
t.Self.IpmiNetmask = node.IpmiNetmask.Get()
t.Self.IpmiUserName = node.IpmiUserName.Get()
t.Self.IpmiPassword = node.IpmiPassword.Get()
t.Self.NetDevs = node.NetDevs
t.AllNodes = allNodes

View File

@@ -8,15 +8,13 @@ if [ ! -e /dev/ipmi0 ]; then
ls -la /dev/ipmi0
fi
IP="{{.Self.IpmiIpaddr}}"
NETMASK="{{.Self.IpmiNetmask}}"
GATEWAY="{{.Self.NetDevs.eth0.Gateway}}"
USER="{{.Self.IpmiUserName}}"
PASS="{{.Self.IpmiPassword}}"
IP="{{$.Self.IpmiIpaddr}}"
NETMASK="{{$.Self.IpmiNetmask}}"
USER="{{$.Self.IpmiUserName}}"
PASS="{{$.Self.IpmiPassword}}"
echo IP is $IP
echo NETMASK is $NETMASK
echo GATEWAY is $GATEWAY
echo USER is $USER
echo PASS is $PASS