devops/quadlets/modules/rabbitmq/main.tf

60 lines
1.1 KiB
HCL

variable "wait_on" {
type = any
description = "Resources to wait on"
default = true
}
variable "server_ip" {
type = string
}
variable "ssh_private_key_path" {
type = string
}
resource "random_password" "username" {
length = 32
special = false
}
resource "random_password" "password" {
length = 32
special = false
}
module "rabbitmq" {
source = "../quadlet-app"
wait_on = var.wait_on
server_ip = var.server_ip
ssh_private_key_path = var.ssh_private_key_path
app_name = "rabbitmq"
image = "docker.io/rabbitmq:management"
ports = ["5672:5672", "15672:15672"]
volumes = ["/opt/storage/data/rabbitmq:/var/lib/rabbitmq:Z"]
environment = {
RABBITMQ_DEFAULT_USER = random_password.username.result
RABBITMQ_DEFAULT_PASS = random_password.password.result
}
}
output "app_urls" {
value = module.rabbitmq.app_urls
}
output "installed" {
value = true
depends_on = [module.rabbitmq.installed]
}
output "username" {
value = random_password.username.result
sensitive = true
}
output "password" {
value = random_password.password.result
sensitive = true
}