platform: linux
inputs:
 - name: ccp_src
 - name: cluster_env_files
 - name: sqldump
run:
  path: bash
  args:
  - -c
  - |
    set -ex
    ccp_src/scripts/setup_ssh_to_cluster.sh
    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'"
    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'

platform: linux
inputs:
 - name: ccp_src
 - name: cluster_env_files
 - name: sqldump
run:
  path: bash
  args:
  - -c
  - |
    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 $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'

Make mdw sudo user name a var
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

[GPR-1016]

Co-authored-by: Lucas Bonner <54393c882c6afc1deae575bec937ac78c1977860@vmware.com>
Co-authored-by: Shaoqi Bai <7e128f5f13b82562f8df0d475a28b2c22e78dec3@vmware.com>
