Move all configurations to a separate config that can be sourced as needed

This commit is contained in:
Gregory Kurtzer
2020-12-20 23:14:55 -08:00
parent f873185858
commit 54b5d8e4a6
9 changed files with 30 additions and 33 deletions

View File

@@ -52,7 +52,7 @@ files: all
# cp -r tftpboot/* /var/lib/tftpboot/warewulf/ipxe/
# restorecon -r /var/lib/tftpboot/warewulf
cp -r overlays /var/warewulf/
chmod +x /var/warewulf/overlays/system/default/init.ww
chmod +x /var/warewulf/overlays/system/default/init
chmod 600 /var/warewulf/overlays/system/default/etc/ssh/ssh*
chmod 644 /var/warewulf/overlays/system/default/etc/ssh/ssh*.pub.ww
mkdir -p /var/warewulf/overlays/system/default/warewulf/bin/

View File

@@ -5,24 +5,14 @@
#
# Edit at your own risk! DANGER DANGER.
WWCONTAINER={{$.Container}}
export WWCONTAINER
WWHOSTNAME={{$.Id}}
export WWHOSTNAME
WWROOT={{$.Root}}
export WWROOT
WWINIT={{$.Init}}
export WWINIT
WWIPMI_IPADDR="{{$.IpmiIpaddr}}"
export WWIPMI_IPADDR
WWIPMI_NETMASK="{{$.IpmiNetmask}}"
export WWIPMI_NETMASK
WWIPMI_GATEWAY="{{$.IpmiGateway}}"
export WWIPMI_GATEWAY
WWIPMI_USER="{{$.IpmiUserName}}"
export WWIPMI_USER
WWIPMI_PASSWORD="{{$.IpmiPassword}}"
export WWIPMI_PASSWORD
if test -f "/warewulf/config"; then
. /warewulf/config
else
echo "ERROR: Warewulf configuration file not found... rebooting in 1 minute"
sleep 60
/sbin/reboot
fi
echo "Warewulf v4 is now booting: $WWHOSTNAME"
echo

View File

@@ -0,0 +1,9 @@
WWCONTAINER={{$.Container}}
WWHOSTNAME={{$.Id}}
WWROOT={{$.Root}}
WWINIT={{$.Init}}
WWIPMI_IPADDR="{{$.IpmiIpaddr}}"
WWIPMI_NETMASK="{{$.IpmiNetmask}}"
WWIPMI_GATEWAY="{{$.IpmiGateway}}"
WWIPMI_USER="{{$.IpmiUserName}}"
WWIPMI_PASSWORD="{{$.IpmiPassword}}"

View File

@@ -1,4 +1,6 @@
#!/bin/sh
. /warewulf/config
echo "Bringing up lo:127.0.0.1"
/sbin/ip link set dev lo up

View File

@@ -1,5 +1,7 @@
#!/bin/bash
. /warewulf/config
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
if [ -z "$WWIPMI_IPADDR" ]; then

View File

@@ -1,6 +1,6 @@
#!/bin/sh
. /warewulf/config
# This will eventually be optional
if true; then

View File

@@ -1,4 +1,6 @@
#!/bin/sh
. /warewulf/config
echo "Starting wwclient"
nohup /warewulf/bin/wwclient >/var/log/wwclient.log 2>&1 </dev/null &

View File

@@ -1,5 +1,6 @@
#!/bin/bash
. /warewulf/config
if test -z "$WWROOT"; then
echo "Skipping SELinux configuration: Warewulf Root device not set"

View File

@@ -2,6 +2,8 @@
echo "Hello from WWINIT"
. /warewulf/config
for i in /warewulf/init.d/*; do
NAME=`basename $i`
echo "Launching: $NAME"
@@ -10,20 +12,9 @@ done
/bin/bash
INIT=$WWINIT
echo "Cleaning up"
unset WWCONTAINER
unset WWHOSTNAME
unset WWROOT
unset WWINIT
unset WWIPMI_IPADDR
unset WWIPMI_NETMASK
unset WWIPMI_GATEWAY
unset WWIPMI_USER
unset WWIPMI_PASSWORD
echo "Calling $INIT..."
echo "Calling $WWINIT..."
echo
sleep 2
exec $INIT
exec $WWINIT