variable "wait_on" {
  type        = any
  description = "Resources to wait on"
  default     = true
}

variable "server_ip" {
  type = string
}

variable "ssh_private_key_path" {
  type = string
}

module "redis" {
  source = "../quadlet-app"
  wait_on = var.wait_on

  server_ip            = var.server_ip
  ssh_private_key_path = var.ssh_private_key_path

  app_name = "redis"
  image    = "docker.io/redis:7-alpine"
  ports    = ["6379:6379"]
  volumes  = ["/opt/storage/data/redis:/data:Z"]
  command  = ["redis-server", "--appendonly", "yes"]
}

output "app_urls" {
  value = module.redis.app_urls
}

output "installed" {
  value = true
  depends_on = [module.redis.installed]
}