Files
nomad/enos/modules/upgrade_clients/scripts/set_metadata.sh
Juana De La Cuesta 4a75d2de63 Adjust the servers to be always linux instances (#25172)
* func: add possibility of having different binaries for server and clients

* style: rename binaries modules

* docs: update comments

* fix: correct the token input variable for fetch binaries
2025-02-24 13:09:57 +01:00

19 lines
520 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
set -euo pipefail
if ! client_id=$(nomad node status -address "https://$CLIENT_IP:4646" -self -json | jq '.ID' | tr -d '"'); then
echo "No client found at $CLIENT_IP"
exit 1
fi
if ! nomad node meta apply \
-node-id "$client_id" node_ip="$CLIENT_IP" nomad_addr="$NOMAD_ADDR"; then
echo "Failed to set metadata for node: $client_id at $CLIENT_IP"
exit 1
fi
echo "Metadata updated in $client_id at $CLIENT_IP"