Skip to content

Commit 49dcba2

Browse files
authored
Add logic in rotation scirpt of checking if compute fleet STOPPED (#2468)
1 parent 02c0676 commit 49dcba2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cookbooks/aws-parallelcluster-slurm/templates/default/slurm/head_node/update_munge_key.sh.erb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ MUNGE_USER="<%= @munge_user %>"
1515
MUNGE_GROUP="<%= @munge_group %>"
1616
CLUSTER_USER="<%= @cluster_user %>"
1717

18+
# Check compute fleet status
19+
compute_fleet_status=$(get-compute-fleet-status.sh)
20+
if ! echo "$compute_fleet_status" | grep -q '"status": "STOPPED"'; then
21+
echo "Compute fleet is not stopped. Please stop it before updating the munge key."
22+
exit 1
23+
fi
24+
1825
# If SECRET_ARN is provided, fetch the munge key from Secrets Manager
1926
if [ -n "${SECRET_ARN}" ]; then
2027
echo "Fetching munge key from AWS Secrets Manager: ${SECRET_ARN}"

0 commit comments

Comments
 (0)