From 002146b2f7efa41a23673993d06808541d7c028b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 28 Apr 2021 13:27:34 -0400 Subject: [PATCH] Try to output pre/post content to console during install --- confluent_osdeploy/el7/profiles/default/scripts/post.sh | 3 ++- confluent_osdeploy/el7/profiles/default/scripts/pre.sh | 7 ++++--- confluent_osdeploy/el8/profiles/default/scripts/post.sh | 3 ++- confluent_osdeploy/el8/profiles/default/scripts/pre.sh | 9 +++++---- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/confluent_osdeploy/el7/profiles/default/scripts/post.sh b/confluent_osdeploy/el7/profiles/default/scripts/post.sh index 98f3b0c1..745bd75c 100644 --- a/confluent_osdeploy/el7/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/el7/profiles/default/scripts/post.sh @@ -1,4 +1,5 @@ #!/bin/sh +tail -f ${0}.log >& /dev/tty & # need to copy over ssh key info nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}') apikey=$(cat /etc/confluent/confluent.apikey) @@ -41,4 +42,4 @@ run_remote_parts post # Induce execution of remote configuration, e.g. ansible plays in ansible/post.d/ run_remote_config post -curl -X POST -d 'status: staged' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/updatestatus +curl -sf -X POST -d 'status: staged' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/updatestatus diff --git a/confluent_osdeploy/el7/profiles/default/scripts/pre.sh b/confluent_osdeploy/el7/profiles/default/scripts/pre.sh index c6239aa2..1073359b 100644 --- a/confluent_osdeploy/el7/profiles/default/scripts/pre.sh +++ b/confluent_osdeploy/el7/profiles/default/scripts/pre.sh @@ -1,4 +1,5 @@ #!/bin/sh +tail -f ${0}.log >& /dev/tty & # This runs prior to the installer beginning. This is used to rewrite the # scripted install file, merging data from confluent and identifying @@ -28,7 +29,7 @@ if [ "$rootpw" = null ]; then else echo "rootpw --iscrypted $rootpw" > /tmp/rootpw fi -curl -f https://$mgr/confluent-public/os/$profile/profile.yaml > /tmp/instprofile.yaml +curl -sf https://$mgr/confluent-public/os/$profile/profile.yaml > /tmp/instprofile.yaml blargs=$(grep ^installedargs: /tmp/instprofile.yaml | sed -e 's/#.*//' -e 's/^installedargs: //') if [ ! -z "$blargs" ]; then blargs=' --append="'$blargs'"' @@ -45,7 +46,7 @@ fi ssh-keygen -A for pubkey in /etc/ssh/ssh_host*key.pub; do certfile=${pubkey/.pub/-cert.pub} - curl -f -X POST -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $(cat /etc/confluent/confluent.apikey)" -d @$pubkey https://$mgr/confluent-api/self/sshcert > $certfile + 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 /usr/sbin/sshd -f /etc/ssh/sshd_config.anaconda @@ -63,7 +64,7 @@ fi export mgr profile nodename -curl -f https://$mgr/confluent-public/os/$profile/scripts/functions > /tmp/functions +curl -sf https://$mgr/confluent-public/os/$profile/scripts/functions > /tmp/functions . /tmp/functions run_remote pre.custom run_remote_parts pre diff --git a/confluent_osdeploy/el8/profiles/default/scripts/post.sh b/confluent_osdeploy/el8/profiles/default/scripts/post.sh index 98f3b0c1..745bd75c 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/el8/profiles/default/scripts/post.sh @@ -1,4 +1,5 @@ #!/bin/sh +tail -f ${0}.log >& /dev/tty & # need to copy over ssh key info nodename=$(grep ^NODENAME /etc/confluent/confluent.info|awk '{print $2}') apikey=$(cat /etc/confluent/confluent.apikey) @@ -41,4 +42,4 @@ run_remote_parts post # Induce execution of remote configuration, e.g. ansible plays in ansible/post.d/ run_remote_config post -curl -X POST -d 'status: staged' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/updatestatus +curl -sf -X POST -d 'status: staged' -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $apikey" https://$mgr/confluent-api/self/updatestatus diff --git a/confluent_osdeploy/el8/profiles/default/scripts/pre.sh b/confluent_osdeploy/el8/profiles/default/scripts/pre.sh index 82680788..ed03476a 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/pre.sh +++ b/confluent_osdeploy/el8/profiles/default/scripts/pre.sh @@ -8,6 +8,7 @@ # method is to edit the kicktstart file and comment out or # delete %include /tmp/partitioning +tail -f ${0}.log >& /dev/tty & /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 @@ -34,7 +35,7 @@ if [ "$rootpw" = null ]; then else echo "rootpw --iscrypted $rootpw" > /tmp/rootpw fi -curl -f https://$mgr/confluent-public/os/$profile/profile.yaml > /tmp/instprofile.yaml +curl -sf https://$mgr/confluent-public/os/$profile/profile.yaml > /tmp/instprofile.yaml blargs=$(grep ^installedargs: /tmp/instprofile.yaml | sed -e 's/#.*//' -e 's/^installedargs: //') if [ ! -z "$blargs" ]; then blargs=' --append="'$blargs'"' @@ -50,7 +51,7 @@ if [ ! -z "$blargs" ]; then fi for pubkey in /etc/ssh/ssh_host*key.pub; do certfile=${pubkey/.pub/-cert.pub} - curl -f -X POST -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $(cat /etc/confluent/confluent.apikey)" -d @$pubkey https://$mgr/confluent-api/self/sshcert > $certfile + 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 /usr/sbin/sshd -f /etc/ssh/sshd_config.anaconda @@ -70,7 +71,7 @@ fi export mgr profile nodename -curl -f https://$mgr/confluent-public/os/$profile/scripts/functions > /tmp/functions +curl -sf https://$mgr/confluent-public/os/$profile/scripts/functions > /tmp/functions . /tmp/functions run_remote pre.custom run_remote_parts pre @@ -82,4 +83,4 @@ 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 -f https://$mgr/confluent-public/os/$profile/kickstart.custom > /tmp/kickstart.custom +curl -sf https://$mgr/confluent-public/os/$profile/kickstart.custom > /tmp/kickstart.custom