system overlay updates from IPMI and real node boot testing

This commit is contained in:
Shannon V. Davidson
2020-12-07 12:17:55 -06:00
parent 20f39b2435
commit 18fe980a93
5 changed files with 60 additions and 28 deletions

View File

@@ -14,4 +14,4 @@ Include: yum
shadow-utils rsyslog tcp_wrappers tzdata util-linux words \ shadow-utils rsyslog tcp_wrappers tzdata util-linux words \
zlib tar less gzip which util-linux openssh-clients \ zlib tar less gzip which util-linux openssh-clients \
openssh-server dhclient pciutils vim-minimal shadow-utils \ openssh-server dhclient pciutils vim-minimal shadow-utils \
strace cronie crontabs cpio wget centos-release strace cronie crontabs cpio wget centos-release ipmitool

26
go.mod
View File

@@ -24,7 +24,7 @@ require (
github.com/golang/protobuf v1.4.2 github.com/golang/protobuf v1.4.2
github.com/gorilla/mux v1.7.4 github.com/gorilla/mux v1.7.4
github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a
github.com/kelseyhightower/envconfig v1.4.0 github.com/kelseyhightower/envconfig v1.4.0 // indirect
github.com/klauspost/compress v1.11.1 github.com/klauspost/compress v1.11.1
github.com/klauspost/pgzip v1.2.5 github.com/klauspost/pgzip v1.2.5
github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a
@@ -44,17 +44,17 @@ require (
github.com/russross/blackfriday/v2 v2.0.1 github.com/russross/blackfriday/v2 v2.0.1
github.com/sirupsen/logrus v1.7.0 github.com/sirupsen/logrus v1.7.0
github.com/spf13/cobra v1.1.1 github.com/spf13/cobra v1.1.1
github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31 github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31 // indirect
github.com/ulikunitz/xz v0.5.8 // indirect github.com/ulikunitz/xz v0.5.8
github.com/vbauerster/mpb/v5 v5.3.0 // indirect github.com/vbauerster/mpb/v5 v5.3.0
go.etcd.io/bbolt v1.3.5 // indirect go.etcd.io/bbolt v1.3.5
golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 // indirect golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9
golang.org/x/net v0.0.0-20200602114024-627f9648deb9 // indirect golang.org/x/net v0.0.0-20200602114024-627f9648deb9
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a // indirect golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
golang.org/x/sys v0.0.0-20200909081042-eff7692f9009 // indirect golang.org/x/sys v0.0.0-20200909081042-eff7692f9009
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013
google.golang.org/grpc v1.27.0 // indirect google.golang.org/grpc v1.27.0
google.golang.org/protobuf v1.24.0 // indirect google.golang.org/protobuf v1.24.0
gopkg.in/square/go-jose.v2 v2.3.1 // indirect gopkg.in/square/go-jose.v2 v2.3.1
gopkg.in/yaml.v2 v2.3.0 gopkg.in/yaml.v2 v2.3.0
) )

View File

@@ -6,3 +6,5 @@ GATEWAY={{$.Self.NetDevs.eth0.Gateway}}
HWADDR={{$.Self.NetDevs.eth0.Hwaddr}} HWADDR={{$.Self.NetDevs.eth0.Hwaddr}}
BOOTPROTO=static BOOTPROTO=static
ONBOOT=yes ONBOOT=yes
DEVTIMEOUT=10

View File

@@ -33,6 +33,8 @@ mount -t devtmpfs devtmpfs /dev
nohup /warewulf/bin/wwclient >/var/log/wwclient.log 2>&1 </dev/null & nohup /warewulf/bin/wwclient >/var/log/wwclient.log 2>&1 </dev/null &
nohup /ipmi >/var/log/ipmi.log 2>&1 </dev/null &
echo "Calling /sbin/init..." echo "Calling /sbin/init..."
echo echo

View File

@@ -1,36 +1,62 @@
#!/bin/bash #!/bin/bash
error_exit() {
echo "ERROR: $*"
exit 1
}
export PATH=/usr/bin:/bin:/usr/sbin:/sbin export PATH=/usr/bin:/bin:/usr/sbin:/sbin
if [ ! -e /dev/ipmi0 ]; then
ipmi_dev=$(grep ipmidev /proc/devices | awk '{ print $1; }')
mknod -m 0666 /dev/ipmi0 c $ipmi_dev 0
ls -la /dev/ipmi0
fi
IP="{{$.Self.IpmiIpaddr}}" IP="{{$.Self.IpmiIpaddr}}"
NETMASK="{{$.Self.IpmiNetmask}}" NETMASK="{{$.Self.NetDevs.eth0.Netmask}}"
GATEWAY="{{$.Self.NetDevs.eth0.Gateway}}"
USER="{{$.Self.IpmiUserName}}" USER="{{$.Self.IpmiUserName}}"
PASS="{{$.Self.IpmiPassword}}" PASS="{{$.Self.IpmiPassword}}"
echo IP is $IP echo IP is $IP
echo NETMASK is $NETMASK echo NETMASK is $NETMASK
echo GATEWAY is $GATEWAY
echo USER is $USER echo USER is $USER
echo PASS is $PASS echo PASS is $PASS
exit 0 if [ -z "$IP" ]; then
error_exit "No IPMI IP address supplied, skipping IPMI configuration"
fi
modprobe ipmi_si
modprobe ipmi_ssif
modprobe ipmi_devintf
modprobe ipmi_msghandler
if [ ! -e /dev/ipmi0 ]; then
sleep 1
ipmi_dev=$(grep ipmidev /proc/devices | awk '{ print $1; }')
mknod -m 0666 /dev/ipmi0 c $ipmi_dev 0
ls -la /dev/ipmi0
fi
# Network # Network
ipmitool lan set 1 access on
ipmitool lan set 1 ipsrc static ipmitool lan set 1 ipsrc static
ipmitool lan set 1 ipaddr $IP ipmitool lan set 1 ipaddr $IP
ipmitool lan set 1 netmask $NETMASK ipmitool lan set 1 netmask $NETMASK
ipmitool lan set 1 defgw ipaddr $GATEWAY
# User
if [ "$USER" != "" ]; then
ipmitool user set name 2 $USER
ipmitool user set password 2 $PASS
sleep 1
ipmitool user priv 2 4 1
ipmitool user enable 2
fi
# Authentication # Authentication
ipmitool lan set 1 auth user md5,password #ipmitool lan set 1 auth user md5,password
ipmitool lan set 1 auth operator md5,password #ipmitool lan set 1 auth operator md5,password
ipmitool lan set 1 auth admin md5,password #ipmitool lan set 1 auth admin md5,password
ipmitool user enable 1 #ipmitool user enable 1
ipmitool user priv 1 4 1 #ipmitool user priv 1 4 1
# Authentication (allow None) # Authentication (allow None)
#ipmitool lan set 1 auth user none,md5,password #ipmitool lan set 1 auth user none,md5,password
@@ -42,7 +68,9 @@ ipmitool user priv 1 4 1
# Serial Over LAN # Serial Over LAN
ipmitool sol set force-encryption true 1 ipmitool sol set force-encryption true 1
ipmitool sol set force-authentication true 1 ipmitool sol set force-authentication true 1
ipmitool sol set privilege-level user 1 ipmitool sol set privilege-level admin 1
ipmitool sol payload enable 1 4
ipmitool sol set enabled true 1
ipmitool sol set non-volatile-bit-rate 19.2 1 ipmitool sol set non-volatile-bit-rate 19.2 1
ipmitool sol set volatile-bit-rate 19.2 1 ipmitool sol set volatile-bit-rate 19.2 1