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

correct floating IP column name and use instance ID for assignment

- Fixed the floating IP column name to 'Floating IP Address' in `openstack floating ip list`
parent afe9ee93
No related branches found
No related tags found
1 merge request!2Add OOD proxy node deployment to CI/CD pipeline
...@@ -68,20 +68,21 @@ deploy_ood_proxy_node: ...@@ -68,20 +68,21 @@ deploy_ood_proxy_node:
exit 1 exit 1
fi fi
# Check if the floating IP is available # 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") FLOATING_IP=$(openstack floating ip list --format value --column 'Floating IP Address' | grep -w "$PROXY_IP")
if [ -z "$FLOATING_IP" ]; then if [ -z "$FLOATING_IP" ]; then
echo "ERROR: No Floating IP found for ${PROXY_IP}" echo "ERROR: No Floating IP found for ${PROXY_IP}"
exit 1 exit 1
else else
# Add the floating IP to the created server # Add the floating IP to the newly created instance
openstack server add floating ip $OOD_PROXY_NAME $PROXY_IP openstack server add floating ip $NEW_INSTANCE_ID $FLOATING_IP
echo "Successfully assigned Floating IP: $PROXY_IP to the server" echo "Successfully assigned Floating IP: $FLOATING_IP to the server"
fi fi
# Store the instance ID in variables.env for later use # Store the instance ID in variables.env for later use
echo "PROXY_INSTANCE_ID=$PROXY_INSTANCE_ID" >> $CI_PROJECT_DIR/variables.env echo "NEW_INSTANCE_ID=$NEW_INSTANCE_ID" >> $CI_PROJECT_DIR/variables.env
rules: rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'schedule' - if: $CI_PIPELINE_SOURCE == 'schedule'
......
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