diff --git a/confluent_osdeploy/genesis/profiles/default/scripts/functions b/confluent_osdeploy/genesis/profiles/default/scripts/functions index d70c63db..911eb01f 100644 --- a/confluent_osdeploy/genesis/profiles/default/scripts/functions +++ b/confluent_osdeploy/genesis/profiles/default/scripts/functions @@ -1,10 +1,4 @@ #!/bin/bash -function test_mgr() { - if curl -s https://${1}/confluent-api/ > /dev/null; then - return 0 - fi - return 1 -} function confluentpython() { if [ -x /usr/libexec/platform-python ]; then @@ -22,29 +16,9 @@ function set_confluent_vars() { if [ -z "$nodename" ]; then nodename=$(grep ^NODENAME: /etc/confluent/confluent.info | awk '{print $2}') fi - if [[ "$confluent_mgr" == *"%"* ]]; then - confluent_mgr="" - fi - if [ -z "$confluent_mgr" ]; then - confluent_mgr=$(grep ^deploy_server: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //') - if ! test_mgr $confluent_mgr; then - confluent_mgr=$(grep ^deploy_server_v6: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //') - if [[ "$confluent_mgr" = *":"* ]]; then - confluent_mgr="[$confluent_mgr]" - fi - fi - if ! test_mgr $confluent_mgr; then - BESTMGRS=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info | grep '|1$' | sed -e 's/EXTMGRINFO: //' -e 's/|.*//') - OKMGRS=$(grep ^EXTMGRINFO: /etc/confluent/confluent.info | grep '|0$' | sed -e 's/EXTMGRINFO: //' -e 's/|.*//') - for confluent_mgr in $BESTMGRS $OKMGRS; do - if [[ $confluent_mgr == *":"* ]]; then - confluent_mgr="[$confluent_mgr]" - fi - if test_mgr $confluent_mgr; then - break - fi - done - fi + confluent_mgr=$(confluentpython /opt/confluent/bin/apiclient -c) + if [[ "$confluent_mgr" = *":"* ]]; then + confluent_mgr="[$confluent_mgr]" fi if [ -z "$confluent_profile" ]; then confluent_profile=$(grep ^profile: /etc/confluent/confluent.deploycfg | sed -e 's/[^ ]*: //') @@ -52,13 +26,13 @@ function set_confluent_vars() { } fetch_remote() { - curlargs="" - if [ -f /etc/confluent/ca.pem ]; then - curlargs=" --cacert /etc/confluent/ca.pem" - fi set_confluent_vars + apiclient=/opt/confluent/bin/apiclient + if [ -f /etc/confluent/apiclient ]; then + apiclient=/etc/confluent/apiclient + fi mkdir -p $(dirname $1) - curl -f -sS $curlargs https://$confluent_mgr/confluent-public/os/$confluent_profile/scripts/$1 > $1 + confluentpython $apiclient /confluent-public/os/$confluent_profile/scripts/$1 -o $1 if [ $? != 0 ]; then echo $1 failed to download; return 1; fi } @@ -156,16 +130,13 @@ run_remote() { run_remote_python() { echo set_confluent_vars - if [ -f /etc/confluent/ca.pem ]; then - curlargs=" --cacert /etc/confluent/ca.pem" - fi echo '---------------------------------------------------------------------------' echo Running python script "'$*'" from https://$confluent_mgr/confluent-public/os/$confluent_profile/scripts/ confluentscripttmpdir=$(mktemp -d /tmp/confluentscripts.XXXXXXXXX) echo Executing in $confluentscripttmpdir cd $confluentscripttmpdir mkdir -p $(dirname $1) - curl -f -sS $curlargs https://$confluent_mgr/confluent-public/os/$confluent_profile/scripts/$1 > $1 + confluentpython /opt/confluent/bin/apiclient /confluent-public/os/$confluent_profile/scripts/$1 -o $1 if [ $? != 0 ]; then echo "'$*'" failed to download; return 1; fi confluentpython $* retcode=$? diff --git a/genesis/97genesis/install-base b/genesis/97genesis/install-base index b0e56743..5d43f9b8 100644 --- a/genesis/97genesis/install-base +++ b/genesis/97genesis/install-base @@ -4,7 +4,7 @@ dracut_install /lib64/libtss2-tcti-device.so.0 dracut_install tpm2_create tpm2_pcrread tpm2_createpolicy tpm2_createprimary dracut_install tpm2_load tpm2_unseal tpm2_getcap tpm2_evictcontrol dracut_install tpm2_pcrextend tpm2_policypcr tpm2_flushcontext tpm2_startauthsession -dracut_install curl openssl tar ipmitool cpio xz gzip lsmod ethtool +dracut_install openssl tar ipmitool cpio xz gzip lsmod ethtool dracut_install modprobe touch echo cut wc bash netstat uniq grep ip hostname dracut_install awk egrep dirname bc expr sort dracut_install ssh sshd vi reboot lspci parted tmux mkfs mkfs.ext4 mkfs.xfs xfs_db mkswap