From 440fcf26637db23fb5d2268ba25f73893118e934 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 14 Sep 2022 12:18:11 -0400 Subject: [PATCH] Further tweak el8 ident image support --- .../lib/dracut/hooks/pre-trigger/01-confluent.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/pre-trigger/01-confluent.sh b/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/pre-trigger/01-confluent.sh index edade3ba..5e84bd3e 100644 --- a/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/pre-trigger/01-confluent.sh +++ b/confluent_osdeploy/el8/initramfs/usr/lib/dracut/hooks/pre-trigger/01-confluent.sh @@ -85,7 +85,7 @@ if [ -e /dev/disk/by-label/CNFLNT_IDNT ]; then if curl -f -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_CRYPTHMAC: $(cat $hmacfile)" -d@$passcrypt -k https://$deployer/confluent-api/self/registerapikey; then cp $passfile /etc/confluent/confluent.apikey confluent_apikey=$(cat /etc/confluent/confluent.apikey) - curl -sf -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $confluent_apikey" https://$deployer/confluent-api/self/deploycfg > /etc/confluent/confluent.deploycfg + curl -sf -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $confluent_apikey" https://$deployer/confluent-api/self/deploycfg2 > /etc/confluent/confluent.deploycfg confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg) confluent_profile=${confluent_profile#profile: } break @@ -122,10 +122,15 @@ while ! confluentpython /opt/confluent/bin/apiclient $errout /confluent-api/self sleep 10 done ifidx=$(cat /tmp/confluent.ifidx) -ifname=$(ip link |grep ^$ifidx:|awk '{print $2}') -ifname=${ifname%:} -ifname=${ifname%@*} -echo $ifname > /tmp/net.ifaces +if [ ! -z "$ifidx" ]; then + ifname=$(ip link |grep ^$ifidx:|awk '{print $2}') + ifname=${ifname%:} + ifname=${ifname%@*} + echo $ifname > /tmp/net.ifaces +else + ip -br a|grep UP|awk '{print $1}' > /tmp/net.ifaces + ifname=$(cat /tmp/net.ifaces) +fi dnsdomain=$(grep ^dnsdomain: /etc/confluent/confluent.deploycfg) dnsdomain=${dnsdomain#dnsdomain: }