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

41 lines
906 B
Terraform
Raw Normal View History

2024-05-12 13:43:53 +00:00
resource "juju_machine" "rmq" {
count = var.num_units
model = juju_model.openstack.name
2024-05-13 07:12:59 +00:00
placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids[count.index+var.num_units]].machine_id])
constraints = "spaces=oam"
}
resource "juju_application" "rabbitmq-server" {
name = "rabbitmq-server"
model = juju_model.openstack.name
charm {
name = "rabbitmq-server"
2024-05-12 13:43:53 +00:00
channel = var.rabbitmq-server-channel
}
units = 3
2024-05-12 13:43:53 +00:00
placement = "${join(",", sort([
for res in juju_machine.rmq :
res.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"
}
}