terraform/juju/home-maas/04-rmq.tf

52 lines
1.2 KiB
Terraform
Raw Normal View History

resource "juju_machine" "rmq-1" {
2024-05-07 19:23:43 +00:00
model = var.model-name
placement = join(":",["lxd",juju_machine.all_machines["103"].machine_id])
constraints = "spaces=oam"
}
resource "juju_machine" "rmq-2" {
2024-05-07 19:23:43 +00:00
model = var.model-name
placement = join(":",["lxd",juju_machine.all_machines["104"].machine_id])
constraints = "spaces=oam"
}
resource "juju_machine" "rmq-3" {
2024-05-07 19:23:43 +00:00
model = var.model-name
placement = join(":",["lxd",juju_machine.all_machines["105"].machine_id])
constraints = "spaces=oam"
}
resource "juju_application" "rabbitmq-server" {
name = "rabbitmq-server"
model = var.model-name
charm {
name = "rabbitmq-server"
channel = "3.8/stable"
}
units = 3
placement = "${join(",",sort([
juju_machine.rmq-1.machine_id,
juju_machine.rmq-2.machine_id,
juju_machine.rmq-3.machine_id,
]))}"
endpoint_bindings = [{
2024-05-07 19:23:43 +00:00
space = var.oam-space
},{
endpoint = "amqp"
2024-05-07 19:23:43 +00:00
space = var.internal-space
},{
endpoint = "cluster"
2024-05-07 19:23:43 +00:00
space = var.internal-space
}]
config = {
2024-05-07 19:23:43 +00:00
source = var.openstack-origin
min-cluster-size = "3"
cluster-partition-handling = "pause_minority"
}
}