From 4e8cc3d801d9a71b604d3e4a84d9f57a8a423a24 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 16 Apr 2020 11:54:40 -0400 Subject: [PATCH] Carry API key past initramfs This enables api calls during the installer. --- misc/confluent-initqueue.sh.rh8 | 4 ++++ misc/confluent-prepivot.sh.rh8 | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/misc/confluent-initqueue.sh.rh8 b/misc/confluent-initqueue.sh.rh8 index 43b62eb2..8237b2b4 100644 --- a/misc/confluent-initqueue.sh.rh8 +++ b/misc/confluent-initqueue.sh.rh8 @@ -25,6 +25,10 @@ nodename=$(grep ^NODENAME /tmp/confluent.info|awk '{print $2}') if [ -z "$apikey" ]; then apikey=$(/opt/confluent/bin/clortho $nodename $mgr) fi +oum=$(umask) +umask 0077 +echo $apikey > /etc/confluent.apikey +umask $oum mgr="[$mgr]" curl -f -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/deploycfg > /tmp/confluent.deploycfg diff --git a/misc/confluent-prepivot.sh.rh8 b/misc/confluent-prepivot.sh.rh8 index 6bdbdcf3..1cfb6457 100644 --- a/misc/confluent-prepivot.sh.rh8 +++ b/misc/confluent-prepivot.sh.rh8 @@ -10,4 +10,5 @@ sed -i 's/root::/root:*:/' /sysroot/etc/shadow mkdir -p /sysroot/root/.ssh chmod 700 /sysroot/root/.ssh cp /ssh/authorized_keys /sysroot/root/.ssh -chmod 600 /sysroot/root/.ssh/authorized_keys \ No newline at end of file +chmod 600 /sysroot/root/.ssh/authorized_keys +cp /etc/confluent.apikey /sysroot/etc/ \ No newline at end of file