shuttles #2

Open
thomas wants to merge 27 commits from shuttles into main
1 changed files with 7 additions and 5 deletions
Showing only changes of commit 49b2a6c38a - Show all commits

View File

@ -57,6 +57,7 @@ variable "haproxy_services" {
port = string port = string
host = optional(string, "127.0.0.1") host = optional(string, "127.0.0.1")
tls = optional(bool, false) tls = optional(bool, false)
grpc_port = optional(string, "")
})) }))
default = [] default = []
} }
@ -85,7 +86,8 @@ locals {
"Label=haproxy.${svc.name}.domain=${svc.domain}", "Label=haproxy.${svc.name}.domain=${svc.domain}",
"Label=haproxy.${svc.name}.port=${svc.port}", "Label=haproxy.${svc.name}.port=${svc.port}",
"Label=haproxy.${svc.name}.host=${svc.host}", "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" { provisioner "remote-exec" {
inline = compact(flatten([ 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 # 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 # Create base quadlet file
"cat > /tmp/${var.app_name}.container << 'EOF'", "cat > /tmp/${var.app_name}.container << 'EOF'",
@ -123,6 +122,8 @@ resource "null_resource" "deploy_quadlet_app" {
"", "",
"[Container]", "[Container]",
"Image=${var.image}", "Image=${var.image}",
"AutoUpdate=registry",
"Network=containers.network"
], ],
# Add ports (only if not empty) # 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) # Add pre-computed HAProxy labels (only if not empty)
length(local.haproxy_labels) > 0 ? local.haproxy_labels : [], length(local.haproxy_labels) > 0 ? local.haproxy_labels : [],
# Add health checks if not empty # Add health checks if not empty
var.healthcmd != "" ? ["HealthCmd=${var.healthcmd}"] : [], var.healthcmd != "" ? ["HealthCmd=${var.healthcmd}"] : [],