From ff0e89e55dcd0131b9fa9140d5b82e9523f610c0 Mon Sep 17 00:00:00 2001 From: "juvenal.diaz" Date: Fri, 23 Oct 2026 22:20:53 -0600 Subject: [PATCH] feat: configure edge from OCI foundation output --- lib/jeannie/commands.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/jeannie/commands.sh b/lib/jeannie/commands.sh index 0a7931d..1621593 100644 --- a/lib/jeannie/commands.sh +++ b/lib/jeannie/commands.sh @@ -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)