From b5b9631b3f75b0e9c76d45fc93ef6555aadf176c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 30 Apr 2021 16:27:16 -0400 Subject: [PATCH] Correct typo in pre script --- .../el7/profiles/default/scripts/post.sh | 2 +- .../el7/profiles/default/scripts/pre.sh | 4 ++-- .../el8/profiles/default/scripts/post.sh | 2 +- .../el8/profiles/default/scripts/pre.sh | 18 ++++-------------- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/confluent_osdeploy/el7/profiles/default/scripts/post.sh b/confluent_osdeploy/el7/profiles/default/scripts/post.sh index 7991e0c7..70228722 100644 --- a/confluent_osdeploy/el7/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/el7/profiles/default/scripts/post.sh @@ -45,4 +45,4 @@ run_remote_parts post # Induce execution of remote configuration, e.g. ansible plays in ansible/post.d/ run_remote_config post curl -sf -X POST -d 'status: staged' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/updatestatus -kill $logshowpid \ No newline at end of file +kill $logshowpid diff --git a/confluent_osdeploy/el7/profiles/default/scripts/pre.sh b/confluent_osdeploy/el7/profiles/default/scripts/pre.sh index 24b170fc..df6ad9c8 100644 --- a/confluent_osdeploy/el7/profiles/default/scripts/pre.sh +++ b/confluent_osdeploy/el7/profiles/default/scripts/pre.sh @@ -13,7 +13,7 @@ if [ -f "/run/install/cmdline.d/01-autocons.conf" ]; then fi exec >> /tmp/confluent-pre.log tail -f /tmp/confluent-pre.log > /dev/tty & -loogshowpid=$! +logshowpid=$! nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}') locale=$(grep ^locale: /etc/confluent/confluent.deploycfg) locale=${locale#locale: } @@ -78,4 +78,4 @@ if [ -e /tmp/installdisk -a ! -e /tmp/partitioning ]; then echo autopart --nohome $LUKSPARTY >> /tmp/partitioning fi python /etc/confluent/apiclient /confluent-public/os/$profile/kickstart.custom -o /tmp/kickstart.custom -kill $logshowpid \ No newline at end of file +kill $logshowpid diff --git a/confluent_osdeploy/el8/profiles/default/scripts/post.sh b/confluent_osdeploy/el8/profiles/default/scripts/post.sh index 7991e0c7..70228722 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/el8/profiles/default/scripts/post.sh @@ -45,4 +45,4 @@ run_remote_parts post # Induce execution of remote configuration, e.g. ansible plays in ansible/post.d/ run_remote_config post curl -sf -X POST -d 'status: staged' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/updatestatus -kill $logshowpid \ No newline at end of file +kill $logshowpid diff --git a/confluent_osdeploy/el8/profiles/default/scripts/pre.sh b/confluent_osdeploy/el8/profiles/default/scripts/pre.sh index 7b95778e..df6ad9c8 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/pre.sh +++ b/confluent_osdeploy/el8/profiles/default/scripts/pre.sh @@ -9,17 +9,11 @@ # delete %include /tmp/partitioning if [ -f "/run/install/cmdline.d/01-autocons.conf" ]; then consoledev=$(cat /run/install/cmdline.d/01-autocons.conf | sed -e 's!console=!/dev/!' -e 's/,.*//') - tmux a <> $consoledev >&0 2>&1 & + TMUX= tmux a <> $consoledev >&0 2>&1 & fi exec >> /tmp/confluent-pre.log tail -f /tmp/confluent-pre.log > /dev/tty & logshowpid=$! -/usr/libexec/platform-python /etc/confluent/apiclient >& /dev/null -nicname=$(ip link|grep ^$(cat /tmp/confluent.ifidx): | awk '{print $2}' | awk -F: '{print $1}') -nmcli c u $nicname -while ip -6 addr | grep tentative > /dev/null; do - sleep 0.5 -done nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}') locale=$(grep ^locale: /etc/confluent/confluent.deploycfg) locale=${locale#locale: } @@ -54,23 +48,19 @@ fi if [ ! -z "$blargs" ]; then echo "bootloader $blargs" > /tmp/grubpw fi +ssh-keygen -A for pubkey in /etc/ssh/ssh_host*key.pub; do certfile=${pubkey/.pub/-cert.pub} curl -sf -X POST -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $(cat /etc/confluent/confluent.apikey)" -d @$pubkey https://$mgr/confluent-api/self/sshcert > $certfile echo HostCertificate $certfile >> /etc/ssh/sshd_config.anaconda done -grep -v RSAAuthentication /etc/ssh/sshd_config.anaconda > /etc/ssh/sshd_config.anaconda.new -mv /etc/ssh/sshd_config.anaconda.new /etc/ssh/sshd_config.anaconda /usr/sbin/sshd -f /etc/ssh/sshd_config.anaconda - cryptboot=$(grep ^encryptboot: /etc/confluent/confluent.deploycfg | awk '{print $2}') LUKSPARTY='' -touch /tmp/cryptpkglist touch /tmp/addonpackages if [ "$cryptboot" == "tpm2" ]; then LUKSPARTY="--encrypted --passphrase=$(cat /etc/confluent/confluent.apikey)" echo $cryptboot >> /tmp/cryptboot - echo clevis-dracut >> /tmp/cryptpkglist fi @@ -87,5 +77,5 @@ if [ -e /tmp/installdisk -a ! -e /tmp/partitioning ]; then echo ignoredisk --only-use $(cat /tmp/installdisk) >> /tmp/partitioning echo autopart --nohome $LUKSPARTY >> /tmp/partitioning fi -curl -sf https://$mgr/confluent-public/os/$profile/kickstart.custom > /tmp/kickstart.custom -kill $logshowpid \ No newline at end of file +python /etc/confluent/apiclient /confluent-public/os/$profile/kickstart.custom -o /tmp/kickstart.custom +kill $logshowpid