From 49b2a6c38af499b97946d836b89239072f25a4d7 Mon Sep 17 00:00:00 2001 From: Thomas Rijpstra Date: Thu, 25 Jun 2026 09:53:58 +0200 Subject: [PATCH] feat(quadlet-app): enable registry auto-update and shared container network Add AutoUpdate=registry and Network=containers.network to the generated container quadlet, extend haproxy_services with an optional grpc_port field, and drop the now-unused cloud-init/loginctl linger wait from the remote-exec inline steps. --- quadlets/modules/quadlet-app/main.tf | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/quadlets/modules/quadlet-app/main.tf b/quadlets/modules/quadlet-app/main.tf index b4b2c51..027ddf1 100644 --- a/quadlets/modules/quadlet-app/main.tf +++ b/quadlets/modules/quadlet-app/main.tf @@ -57,6 +57,7 @@ variable "haproxy_services" { port = string host = optional(string, "127.0.0.1") tls = optional(bool, false) + grpc_port = optional(string, "") })) default = [] } @@ -85,7 +86,8 @@ locals { "Label=haproxy.${svc.name}.domain=${svc.domain}", "Label=haproxy.${svc.name}.port=${svc.port}", "Label=haproxy.${svc.name}.host=${svc.host}", - "Label=haproxy.${svc.name}.tls=${svc.tls}" + "Label=haproxy.${svc.name}.tls=${svc.tls}", + #"Label=haproxy.${svc.name}.grpc_port=${svc.grpc_port}" ] ]) } @@ -109,11 +111,8 @@ resource "null_resource" "deploy_quadlet_app" { provisioner "remote-exec" { inline = compact(flatten([ [ - # Wait for cloud-init to complete before proceeding - "cloud-init status --wait || true", - # Verify the user systemd session is ready and linger is enabled - "timeout 60 bash -c 'until loginctl show-user fourlights | grep -q \"Linger=yes\"; do sleep 2; done'", + #"timeout 60 bash -c 'until loginctl show-user fourlights | grep -q \"Linger=yes\"; do sleep 2; done'", # Create base quadlet file "cat > /tmp/${var.app_name}.container << 'EOF'", @@ -123,6 +122,8 @@ resource "null_resource" "deploy_quadlet_app" { "", "[Container]", "Image=${var.image}", + "AutoUpdate=registry", + "Network=containers.network" ], # Add ports (only if not empty) @@ -139,6 +140,7 @@ resource "null_resource" "deploy_quadlet_app" { # Add pre-computed HAProxy labels (only if not empty) length(local.haproxy_labels) > 0 ? local.haproxy_labels : [], + # Add health checks if not empty var.healthcmd != "" ? ["HealthCmd=${var.healthcmd}"] : [],