2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-14 01:29:23 +00:00

Carry nic detection through to bottom of Ubuntu

This commit is contained in:
Jarrod Johnson 2023-03-14 15:24:37 -04:00
parent e12578b6ac
commit 0cc588f8e9
2 changed files with 6 additions and 3 deletions

View File

@ -25,9 +25,13 @@ if [ -e /tmp/cnflnthmackeytmp ]; then
chroot . custom-installation/confluent/bin/genpasshmac $passfile $passcrypt $hmacfile $hmackeyfile
chroot . curl -f -H "CONFLUENT_NODENAME: $NODENAME" -H "CONFLUENT_CRYPTHMAC: $(cat /root/$hmacfile)" -d @/tmp/cnflntcryptfile https://$MGR/confluent-api/self/registerapikey
cp /root/$passfile /root/custom-installation/confluent/confluent.apikey
DEVICE=$(cat /tmp/autodetectnic)
else
chroot . custom-installation/confluent/bin/clortho $NODENAME $MGR > /root/custom-installation/confluent/confluent.apikey
MGR=[$MGR]
nic=$(grep ^MANAGER /custom-installation/confluent/confluent.info|grep fe80::|sed -e s/.*%//|head -n 1)
nic=$(ip link |grep ^$nic:|awk '{print $2}')
DEVICE=${nic%:}
fi
if [ -z "$MGTIFACE" ]; then
chroot . usr/bin/curl -f -H "CONFLUENT_NODENAME: $NODENAME" -H "CONFLUENT_APIKEY: $(cat /root//custom-installation/confluent/confluent.apikey)" https://${MGR}/confluent-api/self/deploycfg > $deploycfg
@ -35,11 +39,9 @@ else
chroot . usr/bin/curl -f -H "CONFLUENT_MGTIFACE: $MGTIFACE" -H "CONFLUENT_NODENAME: $NODENAME" -H "CONFLUENT_APIKEY: $(cat /root//custom-installation/confluent/confluent.apikey)" https://${MGR}/confluent-api/self/deploycfg > $deploycfg
fi
umask $oum
nic=$(grep ^MANAGER /custom-installation/confluent/confluent.info|grep fe80::|sed -e s/.*%//|head -n 1)
nic=$(ip link |grep ^$nic:|awk '{print $2}')
DEVICE=${nic%:}
ipv4m=$(grep ^ipv4_method $netcfgfile|awk '{print$2}')
. /scripts/functions
set -x
if [ "$ipv4m" = "dhcp" ]; then
IP=dhcp
configure_networking

View File

@ -29,6 +29,7 @@ if [ -e /dev/disk/by-label/CNFLNT_IDNT ]; then
MYGW=$(grep ^ipv4_gateway: $tcfg | awk '{print $2}')
MYNM=$(grep ^ipv4_netmask: $tcfg | awk '{print $2}')
ipconfig -d $MYIP::$MYGW:$MYNM::$TRYNIC
echo $TRYNIC > /tmp/autodetectnic
else
configure_networking
fi