File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,10 +5,10 @@ inputs:
55 description : " Hetzner Cloud API token"
66 required : true
77 server_names :
8- description : " Comma -separated list of server names"
8+ description : " Space -separated list of server names"
99 required : true
1010 client_names :
11- description : " Comma -separated list of client names (optional)"
11+ description : " Space -separated list of client names (optional)"
1212 required : false
1313 default : " "
1414 db_host :
3838
3939 # Add each server to inventory
4040 i=0
41- IFS=',' read -ra SERVERS <<< "${{ inputs.server_names }}"
42- for SERVER_NAME in "${SERVERS[@]}"; do
41+ for SERVER_NAME in ${{ inputs.server_names }}; do
4342 PUBLIC_IP=$(bash "tools/hetzner/get_public_ip.sh" "$SERVER_NAME")
4443 PRIVATE_IP=$(bash "tools/hetzner/get_private_ip.sh" "$SERVER_NAME")
4544 echo "node-${i} ansible_host=${PUBLIC_IP} private_ip=${PRIVATE_IP} ansible_user=root" >> inventory.ini
5251 echo "" >> inventory.ini
5352 echo "[client_machines]" >> inventory.ini
5453 i=0
55- IFS=',' read -ra CLIENTS <<< "$CLIENT_NAMES"
56- for CLIENT_NAME in "${CLIENTS[@]}"; do
54+ for CLIENT_NAME in $CLIENT_NAMES; do
5755 IP=$(bash "tools/hetzner/get_public_ip.sh" "$CLIENT_NAME")
5856 echo "client-${i} ansible_host=${IP} ansible_user=root" >> inventory.ini
5957 i=$((i + 1))
Original file line number Diff line number Diff line change @@ -174,4 +174,4 @@ jobs:
174174 NODE_NAMES : ${{ needs.generateMatrix.outputs.node_names }}
175175 CLIENT_NAME : ${{ needs.generateMatrix.outputs.client_name }}
176176 HCLOUD_TOKEN : ${{ secrets.HCLOUD_TOKEN }}
177- run : hcloud server delete $NODE_NAMES $CLIENT_NAME
177+ run : echo $NODE_NAMES $CLIENT_NAME | xargs -P0 -n1 hcloud server delete
You can’t perform that action at this time.
0 commit comments