Make mdw sudo user name a var
the name will be rhel on data-gp-releng/gpdb-prod-rhel8-gpdb7
but the name will be rocky on data-gp-releng/gpdb-prod-rhel8-gpdb7
So make it a var so user can pass to the task by ENV SUDO_MDW_USERNAME
@@ -10,8 +10,9 @@ run:
- |
set -ex
ccp_src/scripts/setup_ssh_to_cluster.sh
+ SUDO_MDW_USERNAME=${SUDO_MDW_USERNAME:-rhel}
ssh -t mdw "HOST1=mdw HOST2=sdw1 HOST3=sdw2 HOST4=sdw3 HOST5=sdw4 \
- bash -c 'ssh-keygen -f ~/.ssh/id_rsa -y > ~/.ssh/id_rsa.pub; for i in mdw sdw{1..4}; do ssh rhel@\$i \"sudo chmod 777 /usr/local\"; done'"
+ bash -c 'ssh-keygen -f ~/.ssh/id_rsa -y > ~/.ssh/id_rsa.pub; for i in mdw sdw{1..4}; do ssh $SUDO_MDW_USERNAME@\$i \"sudo chmod 777 /usr/local\"; done'"
ssh -t mdw 'mkdir -p /home/gpadmin/sqldump'
scp sqldump/* mdw:/home/gpadmin/sqldump/
ssh -t mdw 'xz -d /home/gpadmin/sqldump/dump.sql.xz'
