From bb7a72db6595ffb1924fa081358057e03085ae77 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 13 Feb 2023 09:36:42 -0500 Subject: [PATCH] Fix for ipv6 deployment Need to avoid double-bracketing of the server and also disable globbing so curl does not mistake the ip address for a glob attempt. --- .../el7-diskless/profiles/default/scripts/functions | 12 ++++++------ .../el7/profiles/default/scripts/functions | 12 ++++++------ .../el8-diskless/profiles/default/scripts/functions | 12 ++++++------ .../el8/profiles/default/scripts/functions | 12 ++++++------ .../el9-diskless/profiles/default/scripts/functions | 12 ++++++------ .../profiles/default/scripts/functions | 12 ++++++------ .../suse15/profiles/hpc/scripts/functions | 12 ++++++------ .../suse15/profiles/server/scripts/functions | 12 ++++++------ .../ubuntu20.04/profiles/default/scripts/functions | 12 ++++++------ .../ubuntu22.04/profiles/default/scripts/functions | 12 ++++++------ 10 files changed, 60 insertions(+), 60 deletions(-) diff --git a/confluent_osdeploy/el7-diskless/profiles/default/scripts/functions b/confluent_osdeploy/el7-diskless/profiles/default/scripts/functions index 46bb1bdb..026697b7 100644 --- a/confluent_osdeploy/el7-diskless/profiles/default/scripts/functions +++ b/confluent_osdeploy/el7-diskless/profiles/default/scripts/functions @@ -1,10 +1,10 @@ #!/bin/bash function test_mgr() { whost=$1 - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - if curl -s https://${whost}/confluent-api/ > /dev/null; then + if curl -gs https://${whost}/confluent-api/ > /dev/null; then return 0 fi return 1 @@ -63,10 +63,10 @@ fetch_remote() { set_confluent_vars mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo $1 failed to download; return 1; fi } @@ -174,10 +174,10 @@ run_remote_python() { cd $confluentscripttmpdir mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo "'$*'" failed to download; return 1; fi confluentpython $* retcode=$? diff --git a/confluent_osdeploy/el7/profiles/default/scripts/functions b/confluent_osdeploy/el7/profiles/default/scripts/functions index 46bb1bdb..026697b7 100644 --- a/confluent_osdeploy/el7/profiles/default/scripts/functions +++ b/confluent_osdeploy/el7/profiles/default/scripts/functions @@ -1,10 +1,10 @@ #!/bin/bash function test_mgr() { whost=$1 - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - if curl -s https://${whost}/confluent-api/ > /dev/null; then + if curl -gs https://${whost}/confluent-api/ > /dev/null; then return 0 fi return 1 @@ -63,10 +63,10 @@ fetch_remote() { set_confluent_vars mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo $1 failed to download; return 1; fi } @@ -174,10 +174,10 @@ run_remote_python() { cd $confluentscripttmpdir mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo "'$*'" failed to download; return 1; fi confluentpython $* retcode=$? diff --git a/confluent_osdeploy/el8-diskless/profiles/default/scripts/functions b/confluent_osdeploy/el8-diskless/profiles/default/scripts/functions index 46bb1bdb..026697b7 100644 --- a/confluent_osdeploy/el8-diskless/profiles/default/scripts/functions +++ b/confluent_osdeploy/el8-diskless/profiles/default/scripts/functions @@ -1,10 +1,10 @@ #!/bin/bash function test_mgr() { whost=$1 - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - if curl -s https://${whost}/confluent-api/ > /dev/null; then + if curl -gs https://${whost}/confluent-api/ > /dev/null; then return 0 fi return 1 @@ -63,10 +63,10 @@ fetch_remote() { set_confluent_vars mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo $1 failed to download; return 1; fi } @@ -174,10 +174,10 @@ run_remote_python() { cd $confluentscripttmpdir mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo "'$*'" failed to download; return 1; fi confluentpython $* retcode=$? diff --git a/confluent_osdeploy/el8/profiles/default/scripts/functions b/confluent_osdeploy/el8/profiles/default/scripts/functions index 46bb1bdb..026697b7 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/functions +++ b/confluent_osdeploy/el8/profiles/default/scripts/functions @@ -1,10 +1,10 @@ #!/bin/bash function test_mgr() { whost=$1 - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - if curl -s https://${whost}/confluent-api/ > /dev/null; then + if curl -gs https://${whost}/confluent-api/ > /dev/null; then return 0 fi return 1 @@ -63,10 +63,10 @@ fetch_remote() { set_confluent_vars mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo $1 failed to download; return 1; fi } @@ -174,10 +174,10 @@ run_remote_python() { cd $confluentscripttmpdir mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo "'$*'" failed to download; return 1; fi confluentpython $* retcode=$? diff --git a/confluent_osdeploy/el9-diskless/profiles/default/scripts/functions b/confluent_osdeploy/el9-diskless/profiles/default/scripts/functions index 46bb1bdb..026697b7 100644 --- a/confluent_osdeploy/el9-diskless/profiles/default/scripts/functions +++ b/confluent_osdeploy/el9-diskless/profiles/default/scripts/functions @@ -1,10 +1,10 @@ #!/bin/bash function test_mgr() { whost=$1 - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - if curl -s https://${whost}/confluent-api/ > /dev/null; then + if curl -gs https://${whost}/confluent-api/ > /dev/null; then return 0 fi return 1 @@ -63,10 +63,10 @@ fetch_remote() { set_confluent_vars mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo $1 failed to download; return 1; fi } @@ -174,10 +174,10 @@ run_remote_python() { cd $confluentscripttmpdir mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo "'$*'" failed to download; return 1; fi confluentpython $* retcode=$? diff --git a/confluent_osdeploy/suse15-diskless/profiles/default/scripts/functions b/confluent_osdeploy/suse15-diskless/profiles/default/scripts/functions index 46bb1bdb..026697b7 100644 --- a/confluent_osdeploy/suse15-diskless/profiles/default/scripts/functions +++ b/confluent_osdeploy/suse15-diskless/profiles/default/scripts/functions @@ -1,10 +1,10 @@ #!/bin/bash function test_mgr() { whost=$1 - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - if curl -s https://${whost}/confluent-api/ > /dev/null; then + if curl -gs https://${whost}/confluent-api/ > /dev/null; then return 0 fi return 1 @@ -63,10 +63,10 @@ fetch_remote() { set_confluent_vars mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo $1 failed to download; return 1; fi } @@ -174,10 +174,10 @@ run_remote_python() { cd $confluentscripttmpdir mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo "'$*'" failed to download; return 1; fi confluentpython $* retcode=$? diff --git a/confluent_osdeploy/suse15/profiles/hpc/scripts/functions b/confluent_osdeploy/suse15/profiles/hpc/scripts/functions index 46bb1bdb..026697b7 100644 --- a/confluent_osdeploy/suse15/profiles/hpc/scripts/functions +++ b/confluent_osdeploy/suse15/profiles/hpc/scripts/functions @@ -1,10 +1,10 @@ #!/bin/bash function test_mgr() { whost=$1 - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - if curl -s https://${whost}/confluent-api/ > /dev/null; then + if curl -gs https://${whost}/confluent-api/ > /dev/null; then return 0 fi return 1 @@ -63,10 +63,10 @@ fetch_remote() { set_confluent_vars mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo $1 failed to download; return 1; fi } @@ -174,10 +174,10 @@ run_remote_python() { cd $confluentscripttmpdir mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo "'$*'" failed to download; return 1; fi confluentpython $* retcode=$? diff --git a/confluent_osdeploy/suse15/profiles/server/scripts/functions b/confluent_osdeploy/suse15/profiles/server/scripts/functions index 46bb1bdb..026697b7 100644 --- a/confluent_osdeploy/suse15/profiles/server/scripts/functions +++ b/confluent_osdeploy/suse15/profiles/server/scripts/functions @@ -1,10 +1,10 @@ #!/bin/bash function test_mgr() { whost=$1 - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - if curl -s https://${whost}/confluent-api/ > /dev/null; then + if curl -gs https://${whost}/confluent-api/ > /dev/null; then return 0 fi return 1 @@ -63,10 +63,10 @@ fetch_remote() { set_confluent_vars mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo $1 failed to download; return 1; fi } @@ -174,10 +174,10 @@ run_remote_python() { cd $confluentscripttmpdir mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo "'$*'" failed to download; return 1; fi confluentpython $* retcode=$? diff --git a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/functions b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/functions index 46bb1bdb..026697b7 100644 --- a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/functions +++ b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/functions @@ -1,10 +1,10 @@ #!/bin/bash function test_mgr() { whost=$1 - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - if curl -s https://${whost}/confluent-api/ > /dev/null; then + if curl -gs https://${whost}/confluent-api/ > /dev/null; then return 0 fi return 1 @@ -63,10 +63,10 @@ fetch_remote() { set_confluent_vars mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo $1 failed to download; return 1; fi } @@ -174,10 +174,10 @@ run_remote_python() { cd $confluentscripttmpdir mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo "'$*'" failed to download; return 1; fi confluentpython $* retcode=$? diff --git a/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/functions b/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/functions index 46bb1bdb..026697b7 100644 --- a/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/functions +++ b/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/functions @@ -1,10 +1,10 @@ #!/bin/bash function test_mgr() { whost=$1 - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - if curl -s https://${whost}/confluent-api/ > /dev/null; then + if curl -gs https://${whost}/confluent-api/ > /dev/null; then return 0 fi return 1 @@ -63,10 +63,10 @@ fetch_remote() { set_confluent_vars mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo $1 failed to download; return 1; fi } @@ -174,10 +174,10 @@ run_remote_python() { cd $confluentscripttmpdir mkdir -p $(dirname $1) whost=$confluent_mgr - if [[ "$whost" == *:* ]]; then + if [[ "$whost" == *:* ]] && [[ "$whost" != *[* ]] ; then whost="[$whost]" fi - curl -f -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 + curl -gf -sS $curlargs https://$whost/confluent-public/os/$confluent_profile/scripts/$1 > $1 if [ $? != 0 ]; then echo "'$*'" failed to download; return 1; fi confluentpython $* retcode=$?