Skip to content
Snippets Groups Projects
Commit a23c80b0 authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

fix floating IP creation for OOD deployment

parent a7776019
No related branches found
No related tags found
1 merge request!2Add OOD proxy node deployment to CI/CD pipeline
......@@ -68,20 +68,14 @@ deploy_ood_proxy_node:
exit 1
fi
# Get the available floating IP and ensure it's valid
FLOATING_IP=$(openstack floating ip list --format value --column 'Floating IP Address' | grep -w "$PROXY_IP")
if [ -z "$FLOATING_IP" ]; then
echo "ERROR: No Floating IP found for ${PROXY_IP}"
exit 1
else
# Add the floating IP to the newly created instance
openstack server add floating ip $NEW_INSTANCE_ID $FLOATING_IP
echo "Successfully assigned Floating IP: $FLOATING_IP to the server"
fi
# Create and assign a floating IP
FLOATING_IP=$(openstack floating ip create $PKR_VAR_floating_ip_network -f value -c floating_ip_address)
echo "Created FLOATING_IP: $FLOATING_IP"
# Store the instance ID in variables.env for later use
echo "NEW_INSTANCE_ID=$NEW_INSTANCE_ID" >> $CI_PROJECT_DIR/variables.env
# Associate the floating IP with the proxy instance
openstack server add floating ip $PROXY_INSTANCE_ID $FLOATING_IP
echo "Associated FLOATING_IP $FLOATING_IP with PROXY_INSTANCE_ID $PROXY_INSTANCE_ID"
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment