Compare commits
No commits in common. "0079a89a6c1e162ec0d986b4cc9a8644af821031" and "bbbb71d60f5fbb68d99ca5fbdb70c92e848be7f5" have entirely different histories.
0079a89a6c
...
bbbb71d60f
|
|
@ -16,8 +16,8 @@ locals {
|
|||
base_tags = merge(var.freeform_tags, { managed_by = "jeannie", purpose = "homelab-learning" })
|
||||
edge_monitoring_instance_id = trimspace(var.edge_monitoring_instance_id) != "" ? var.edge_monitoring_instance_id : try(oci_core_instance.edge[0].id, try(data.oci_core_instance.monitoring_edge[0].id, try(data.oci_core_instance.existing_edge[0].id, null)))
|
||||
email_monitoring_instance_id = trimspace(var.email_monitoring_instance_id) != "" ? var.email_monitoring_instance_id : try(oci_core_instance.email[0].id, try(data.oci_core_instance.monitoring_email[0].id, null))
|
||||
edge_monitoring_compartment_id = coalesce(try(data.oci_core_instance.monitoring_edge[0].compartment_id, null), try(data.oci_core_instance.existing_edge[0].compartment_id, null), local.target_compartment_id)
|
||||
email_monitoring_compartment_id = coalesce(try(data.oci_core_instance.monitoring_email[0].compartment_id, null), local.email_compartment_id)
|
||||
edge_monitoring_compartment_id = try(data.oci_core_instance.monitoring_edge[0].compartment_id, try(data.oci_core_instance.existing_edge[0].compartment_id, local.target_compartment_id))
|
||||
email_monitoring_compartment_id = try(data.oci_core_instance.monitoring_email[0].compartment_id, local.email_compartment_id)
|
||||
}
|
||||
|
||||
data "oci_core_subnet" "existing_public" {
|
||||
|
|
@ -253,21 +253,6 @@ resource "oci_core_network_security_group_security_rule" "edge_ssh" {
|
|||
}
|
||||
}
|
||||
|
||||
resource "oci_core_network_security_group_security_rule" "edge_tailnet_ssh" {
|
||||
count = var.enabled && var.edge_enabled && trimspace(var.edge_tailnet_ssh_cidr) != "" ? 1 : 0
|
||||
network_security_group_id = oci_core_network_security_group.edge[0].id
|
||||
direction = "INGRESS"
|
||||
protocol = "6"
|
||||
source = var.edge_tailnet_ssh_cidr
|
||||
source_type = "CIDR_BLOCK"
|
||||
tcp_options {
|
||||
destination_port_range {
|
||||
min = 22
|
||||
max = 22
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "oci_core_network_security_group_security_rule" "edge_bastion_ssh" {
|
||||
count = var.enabled && var.edge_enabled && var.bastion_enabled && trimspace(local.bastion_ssh_source_cidr) != "" ? 1 : 0
|
||||
network_security_group_id = oci_core_network_security_group.edge[0].id
|
||||
|
|
|
|||
|
|
@ -112,12 +112,6 @@ variable "admin_cidr" {
|
|||
default = ""
|
||||
}
|
||||
|
||||
variable "edge_tailnet_ssh_cidr" {
|
||||
description = "Tailscale CGNAT range allowed to SSH directly to the edge VM from the homelab tailnet."
|
||||
type = string
|
||||
default = "100.64.0.0/10"
|
||||
}
|
||||
|
||||
variable "open_mail_ports" {
|
||||
description = "Open SMTP submission, SMTP, and IMAPS ingress in the email NSG. Keep false until DNS/PTR and hardening are complete."
|
||||
type = bool
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ hosts:
|
|||
role: public-edge
|
||||
user: ubuntu
|
||||
public_ip: 132.145.170.74
|
||||
tailscale_ip: 100.122.188.79
|
||||
tailscale_ip: 100.118.255.19
|
||||
install_dir: /opt/homelab-edge
|
||||
|
||||
services:
|
||||
|
|
|
|||
|
|
@ -17,13 +17,7 @@ command -v go >/dev/null 2>&1 || { echo 'Go is required on Debian' >&2; exit 1;
|
|||
|
||||
sudo install -d -m 0755 "${install_dir}" "${repo_root}" /etc/jeannie
|
||||
sudo cp infra/jeannie-temporal/docker-compose.yml "${install_dir}/docker-compose.yml"
|
||||
current_repo="$(pwd -P)"
|
||||
target_repo="$(cd "${repo_root}" && pwd -P)"
|
||||
if [[ "${current_repo}" != "${target_repo}" ]]; then
|
||||
sudo cp -R . "${repo_root}/"
|
||||
else
|
||||
echo "Repository already staged at ${repo_root}; skipping self-copy."
|
||||
fi
|
||||
sudo cp -R . "${repo_root}/"
|
||||
sudo chown -R "$(id -u):$(id -g)" "${repo_root}"
|
||||
|
||||
if command -v ss >/dev/null 2>&1 &&
|
||||
|
|
|
|||
|
|
@ -790,12 +790,6 @@ else
|
|||
fi"
|
||||
}
|
||||
|
||||
tailscale_edge_host() {
|
||||
[[ -n "${LAB_EDGE_TAILSCALE_IP:-}" ]] && { printf '%s\n' "${LAB_EDGE_TAILSCALE_IP}"; return 0; }
|
||||
command -v tailscale >/dev/null 2>&1 || return 1
|
||||
tailscale status 2>/dev/null | awk '$2 == "homelab-oci-edge" || $2 == "homelab-oci-edge.tail767cd.ts.net" { print $1; exit }'
|
||||
}
|
||||
|
||||
start_bastion_compose_stack() {
|
||||
local label="$1" bastion_id="$2" instance_id="$3" user="$4" public_key="$5" private_key="$6" install_dir="$7"
|
||||
[[ -n "${bastion_id}" && -n "${instance_id}" ]] || {
|
||||
|
|
@ -818,13 +812,10 @@ shutdown_rpi_services() {
|
|||
|
||||
shutdown_oci_edge_services() {
|
||||
local edge_host="${LAB_EDGE_HOST:-${LAB_OCI_EDGE_PUBLIC_IP:-}}"
|
||||
local edge_tailnet_host
|
||||
local edge_user="${LAB_EDGE_USER:-ubuntu}"
|
||||
local edge_key="${LAB_EDGE_SSH_KEY_PATH:-${LAB_OCI_SSH_PRIVATE_KEY:-}}"
|
||||
local install_dir="${LAB_EDGE_INSTALL_DIR:-/opt/homelab-edge}"
|
||||
|
||||
edge_tailnet_host="$(tailscale_edge_host || true)"
|
||||
[[ -n "${edge_tailnet_host}" ]] && edge_host="${edge_tailnet_host}"
|
||||
[[ -n "${edge_host}" ]] || {
|
||||
echo "OCI edge host is not configured; set LAB_EDGE_HOST or LAB_OCI_EDGE_PUBLIC_IP." >&2
|
||||
return 1
|
||||
|
|
@ -905,15 +896,11 @@ start_rpi_services() {
|
|||
|
||||
start_oci_edge_services() {
|
||||
local edge_host="${LAB_EDGE_HOST:-${LAB_OCI_EDGE_PUBLIC_IP:-}}"
|
||||
local edge_tailnet_host
|
||||
local edge_user="${LAB_EDGE_USER:-ubuntu}"
|
||||
local edge_key="${LAB_EDGE_SSH_KEY_PATH:-${LAB_OCI_SSH_PRIVATE_KEY:-${HOME}/.ssh/id_ed25519}}"
|
||||
local install_dir="${LAB_EDGE_INSTALL_DIR:-/opt/homelab-edge}"
|
||||
edge_tailnet_host="$(tailscale_edge_host || true)"
|
||||
if [[ -n "${edge_tailnet_host}" ]]; then
|
||||
export LAB_EDGE_TAILSCALE_IP="${edge_tailnet_host}"
|
||||
echo "--> Starting OCI edge services over the homelab tailnet (${edge_tailnet_host})..."
|
||||
start_remote_compose_stack "OCI edge" "${edge_user}@${edge_tailnet_host}" "${install_dir}" "${edge_key}"
|
||||
if truthy "${LAB_OCI_BASTION_ENABLED:-true}" && [[ -n "${LAB_OCI_BASTION_ID:-}" && -n "${LAB_OCI_EDGE_INSTANCE_ID:-}" ]]; then
|
||||
start_bastion_compose_stack "OCI edge" "${LAB_OCI_BASTION_ID}" "${LAB_OCI_EDGE_INSTANCE_ID}" "${edge_user}" "${edge_key}.pub" "${edge_key}" "${install_dir}"
|
||||
else
|
||||
[[ -n "${edge_host}" ]] || { echo "OCI edge host is not configured." >&2; return 1; }
|
||||
start_remote_compose_stack "OCI edge" "${edge_user}@${edge_host}" "${install_dir}" "${edge_key}"
|
||||
|
|
@ -974,7 +961,6 @@ EOF
|
|||
start_rpi_services || failures=$((failures + 1))
|
||||
start_oci_edge_services || failures=$((failures + 1))
|
||||
start_oci_email_services || failures=$((failures + 1))
|
||||
oci_foundation_save_config
|
||||
if systemctl is-active --quiet jeannie-server.service 2>/dev/null; then
|
||||
echo "PASS jeannie-server.service is active."
|
||||
else
|
||||
|
|
@ -3761,10 +3747,10 @@ 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_AUTO_CONFIGURE_EDGE LAB_EDGE_HOST LAB_EDGE_TAILSCALE_IP
|
||||
LAB_OCI_OPEN_MAIL_PORTS LAB_OCI_AUTO_CONFIGURE_EDGE LAB_EDGE_HOST
|
||||
LAB_OCI_AUTO_CONFIGURE_EMAIL LAB_OCI_AUTO_UPDATE_DUCKDNS LAB_DUCKDNS_DOMAINS
|
||||
LAB_OCI_FOUNDATION_STATE_FILE
|
||||
LAB_OCI_MONITORING_ENABLED LAB_OCI_MONITORING_CIDR LAB_OCI_MONITORING_ALARMS_ENABLED LAB_OCI_MONITORING_TOPIC_NAME LAB_OCI_MONITORING_TOPIC_ID LAB_OCI_MONITORING_NOTIFICATION_EMAIL LAB_OCI_EDGE_TAILNET_SSH_CIDR
|
||||
LAB_OCI_MONITORING_ENABLED LAB_OCI_MONITORING_CIDR LAB_OCI_MONITORING_ALARMS_ENABLED LAB_OCI_MONITORING_TOPIC_NAME LAB_OCI_MONITORING_TOPIC_ID LAB_OCI_MONITORING_NOTIFICATION_EMAIL
|
||||
LAB_OCI_BACKUP_BUCKET_ENABLED LAB_OCI_BACKUP_BUCKET LAB_OCI_BACKUP_BUCKET_NAME LAB_OCI_BACKUP_BUCKET_NAMESPACE LAB_OCI_BACKUP_BUCKET_ID
|
||||
LAB_OCI_BASTION_ENABLED LAB_OCI_BASTION_NAME LAB_OCI_BASTION_TARGET_SUBNET_ID LAB_OCI_BASTION_SSH_SOURCE_CIDR
|
||||
LAB_OCI_BASTION_CLIENT_CIDRS_JSON LAB_OCI_BASTION_MAX_SESSION_TTL LAB_OCI_BASTION_ID LAB_OCI_EDGE_COMPARTMENT_ID LAB_OCI_EDGE_INSTANCE_ID LAB_OCI_EMAIL_INSTANCE_ID LAB_OCI_EDGE_INSTANCE_MANAGED
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ mapping = {
|
|||
"hosts.opi5_pimox.worker_storage": "LAB_PIMOX_WORKER_STORAGE",
|
||||
"hosts.oci_edge.user": "LAB_EDGE_USER",
|
||||
"hosts.oci_edge.public_ip": "LAB_EDGE_HOST",
|
||||
"hosts.oci_edge.tailscale_ip": "LAB_EDGE_TAILSCALE_IP",
|
||||
"hosts.oci_edge.install_dir": "LAB_EDGE_INSTALL_DIR",
|
||||
"services.gitea.http_port": "LAB_GITEA_HTTP_PORT",
|
||||
"services.gitea.ssh_port": "LAB_GITEA_SSH_PORT",
|
||||
|
|
@ -268,7 +267,6 @@ export_homelab_inventory_tf_vars() {
|
|||
export_if_unset TF_VAR_pimox_template_build_user "${LAB_CLUSTER_PROVISIONING_USER:-${LAB_DEBIAN_USER:-}}"
|
||||
export_if_unset TF_VAR_pimox_template_guest_ip_prefix "${LAB_LAN_IP_PREFIX:-}"
|
||||
export_if_unset TF_VAR_edge_host "${LAB_EDGE_HOST:-}"
|
||||
export_if_unset TF_VAR_edge_tailnet_ssh_cidr "${LAB_OCI_EDGE_TAILNET_SSH_CIDR:-${LAB_TAILSCALE_CGNAT_CIDR:-100.64.0.0/10}}"
|
||||
export_if_unset TF_VAR_edge_user "${LAB_EDGE_USER:-}"
|
||||
export_if_unset TF_VAR_edge_install_dir "${LAB_EDGE_INSTALL_DIR:-}"
|
||||
local edge_tailscale_auth_key="${LAB_EDGE_TAILSCALE_AUTH_KEY:-}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue