feat: configure edge from OCI foundation output

This commit is contained in:
juvenal.diaz 2026-10-23 22:20:53 -06:00
parent 4cb90fb9e3
commit ff0e89e55d
1 changed files with 14 additions and 1 deletions

View File

@ -3334,7 +3334,7 @@ oci_foundation_config_names=(
LAB_OCI_EXISTING_VCN_ID LAB_OCI_EXISTING_PUBLIC_SUBNET_ID LAB_OCI_EXISTING_EMAIL_SUBNET_ID
LAB_OCI_EMAIL_CREATE_COMPARTMENT LAB_OCI_EMAIL_COMPARTMENT_ID LAB_OCI_EMAIL_COMPARTMENT_NAME
LAB_OCI_EMAIL_SUBNET_CIDR LAB_OCI_EDGE_AVAILABILITY_DOMAIN LAB_OCI_EMAIL_AVAILABILITY_DOMAIN
LAB_OCI_OPEN_MAIL_PORTS
LAB_OCI_OPEN_MAIL_PORTS LAB_OCI_AUTO_CONFIGURE_EDGE LAB_EDGE_HOST
)
oci_foundation_config_file() {
@ -3460,6 +3460,19 @@ oci_foundation_manage() {
else
record_change_journal "oci-foundation" apply "$@"
tofu -chdir="${stack}" apply "$@" -auto-approve
local discovered_edge_ip
discovered_edge_ip="$(tofu -chdir="${stack}" output -raw edge_public_ip 2>/dev/null || true)"
if [[ -n "${discovered_edge_ip}" && "${discovered_edge_ip}" != "null" ]]; then
export LAB_EDGE_HOST="${discovered_edge_ip}"
export TF_VAR_edge_host="${discovered_edge_ip}"
oci_foundation_save_config
if [[ "${LAB_OCI_AUTO_CONFIGURE_EDGE:-true}" == "true" ]]; then
printf 'Configuring edge services at %s...\n' "${discovered_edge_ip}"
edge_apply
else
printf 'Edge services not configured automatically. LAB_EDGE_HOST=%s\n' "${discovered_edge_ip}"
fi
fi
fi
;;
destroy)