Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions tasks/generate-external-ip-db-vars/task
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ cd bbl-state/$BBL_STATE_DIR
set +x

echo "Grabbing public ips"
echo "Outputting public ips to ${VARIABLE_DIR}/external-public-ip-vars.yml"
bbl outputs | grep public_ip > ${VARIABLE_DIR}/external-public-ip-vars.yml
PUBLIC_IP_OUTPUT=$(bbl outputs | grep public_ip || true)
if [[ -n "${PUBLIC_IP_OUTPUT}" ]]; then
echo "Outputting public ips ${PUBLIC_IP_OUTPUT} to ${VARIABLE_DIR}/external-public-ip-vars.yml"
echo "${PUBLIC_IP_OUTPUT}" > "${VARIABLE_DIR}/external-public-ip-vars.yml"
else
echo "No public_ip outputs found; skipping write to ${VARIABLE_DIR}/external-public-ip-vars.yml"
fi

echo "Grabbing DB HOST"
DB_HOST=$(bbl outputs | grep db_host | awk '{print $2}')

echo "Outputting db host to ${VARIABLE_DIR}/external-db-host-vars.yml"
echo "Outputting db host ${DB_HOST} to ${VARIABLE_DIR}/external-db-host-vars.yml"
rm -f ${VARIABLE_DIR}/external-db-host-vars.yml
for key in {cc,uaa,bbs,routing_api,policy_server,silk_controller,locket,credhub}; do
echo "external_${key}_database_address: ${DB_HOST}" >> ${VARIABLE_DIR}/external-db-host-vars.yml;
Expand Down