Skip to content

Commit c8123e9

Browse files
committed
added validation
1 parent 15556bc commit c8123e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ansible/deploy-api-from-local.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ TEMPLATE_REMOTE="${REMOTE_DIR}/templates/movie-api.service.j2"
1414
INVENTORY_LOCAL="./ansible/inventory.ini"
1515
INVENTORY_REMOTE="${REMOTE_DIR}/inventory.ini"
1616

17+
# === STEP 0: JUMPBOX_HOST, JUMPBOX_USER validation===
18+
if [ -z "$JUMPBOX_HOST" ] || [ -z "$JUMPBOX_USER" ]; then
19+
echo "❌ JUMPBOX_HOST or JUMPBOX_USER not defined"
20+
exit 1
21+
fi
22+
1723
# === STEP 1: Upload playbook and inventory ===
1824
echo "[1/4] Uploading playbook and inventory..."
1925
scp -i "${SSH_KEY_LOCAL}" "${API_PLAYBOOK_LOCAL}" "${INVENTORY_LOCAL}" "${JUMP_USER}@${JUMP_HOST}:${REMOTE_DIR}/"

0 commit comments

Comments
 (0)