From 55a6e3a1e2b7ae480c3f464bbae4f427edb35c27 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 5 Aug 2020 09:15:02 -0400 Subject: [PATCH] Support RHV 4.4 Unfortunately, RHV considers rebasing from RHEL7 to RHEL8 to be a 'minor' change. So we have to have a sloppily complicated iniqueue to serve either RHEL7 or RHEL8. --- .../dracut/hooks/initqueue/01-confluent.sh | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/confluent_osdeploy/rhvh4/initramfs/usr/lib/dracut/hooks/initqueue/01-confluent.sh b/confluent_osdeploy/rhvh4/initramfs/usr/lib/dracut/hooks/initqueue/01-confluent.sh index 21c4571e..0d3dc85b 100644 --- a/confluent_osdeploy/rhvh4/initramfs/usr/lib/dracut/hooks/initqueue/01-confluent.sh +++ b/confluent_osdeploy/rhvh4/initramfs/usr/lib/dracut/hooks/initqueue/01-confluent.sh @@ -28,7 +28,25 @@ nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}') #TODO: blkid --label to find mounted api oum=$(umask) -python /opt/confluent/bin/apiclient /confluent-api/self/deploycfg > /etc/confluent/confluent.deploycfg +# 4.3 is rhel7 with useless curl but has python, 4.4 has usable curl but no python.. +if [ -x /usr/bin/python ]; then + python /opt/confluent/bin/apiclient /confluent-api/self/deploycfg > /etc/confluent/confluent.deploycfg +else + mgr=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info| sed -e 's/^EXTMGRINFO: //' | awk -F'|' '{print $1 " " $2 " " $3}' |grep 1$ | awk 'NR < 2') + if [ -z "$mgr" ]; then + mgr=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info| sed -e 's/^EXTMGRINFO: //' | awk -F'|' '{print $1 " " $2 " " $3}' | awk 'NR < 2') + fi + mgtiface=$(echo $mgr | awk '{print $2}') + mgr=$(echo $mgr | awk '{print $1}') + if [ ! -f /etc/confluent/confluent.apikey ]; then + /opt/confluent/bin/clortho $nodename $mgr > /etc/confluent/confluent.apikey + fi + apikey=$(cat /etc/confluent/confluent.apikey) + if echo $mgr | grep ':' > /dev/null; then + mgr="[$mgr]" + fi + curl -f -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" -H "CONFLUENT_MGTIFACE: $mgtiface" https://$mgr/confluent-api/self/deploycfg > /etc/confluent/confluent.deploycfg +fi ifidx=$(cat /tmp/confluent.ifidx) ifname=$(ip link |grep ^$ifidx:|awk '{print $2}') ifname=${ifname%:}