my-homelab-configs/bootstrap/oci/README.md

1.7 KiB

OCI foundation

This independent, opt-in stack creates the OCI foundation for the learning environment: a child compartment (or uses an existing one), VCN, internet and NAT gateways, public/private subnets, NSGs, and separate edge and email VMs. It does not configure the operating systems, install a mail server, create DNS records, or open mail ingress unless open_mail_ports=true is explicitly set.

Credentials come from the standard OCI CLI configuration (~/.oci/config); private keys are not stored in the repository. Use ./jeannie oci-foundation plan first, inspect the plan, then apply from the Debian pipeline host.

The foundation plan/apply path installs OCI CLI into ~/.local/share/homelab/venvs/oci-cli on Debian by default. Set LAB_OCI_CLI_AUTO_INSTALL=false to disable that behavior, or install it explicitly with ./jeannie oci-auth install.

Prepare the config with ./jeannie oci-auth init. The command creates the private key locally, prints the public key for the one-time OCI user upload, and writes the config with restrictive permissions. It never sends the private key to the API or stores it in Git. Run ./jeannie oci-auth check after the public key has been uploaded.

The defaults use the Always Free VM.Standard.E2.1.Micro shape and the Canonical Ubuntu 24.04 Minimal image in us-ashburn-1 supplied for this lab. At minimum, set LAB_OCI_FOUNDATION_ENABLED=true, LAB_OCI_REGION, LAB_OCI_TENANCY_ID, LAB_OCI_ADMIN_CIDR, LAB_OCI_SSH_PUBLIC_KEY, and the image and availability-domain variables for both VMs. Use LAB_OCI_CREATE_COMPARTMENT=false with LAB_OCI_COMPARTMENT_ID when the tenancy policy does not allow creating child compartments.