2024-05-12 13:43:53 +00:00
|
|
|
resource "juju_machine" "rmq" {
|
|
|
|
count = var.num_units
|
2024-05-07 19:23:43 +00:00
|
|
|
model = var.model-name
|
2024-05-12 13:43:53 +00:00
|
|
|
placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids_high[count.index+var.num_units]].machine_id])
|
2024-05-06 16:44:43 +00:00
|
|
|
constraints = "spaces=oam"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_application" "rabbitmq-server" {
|
|
|
|
name = "rabbitmq-server"
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
charm {
|
|
|
|
name = "rabbitmq-server"
|
2024-05-12 13:43:53 +00:00
|
|
|
channel = var.rabbitmq-server-channel
|
2024-05-06 16:44:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
units = 3
|
|
|
|
|
2024-05-12 13:43:53 +00:00
|
|
|
placement = "${join(",", sort([
|
|
|
|
for index, _ in slice(var.controller_ids, var.num_units, length(var.controller_ids)) :
|
|
|
|
juju_machine.rmq[index].machine_id
|
2024-05-06 16:44:43 +00:00
|
|
|
]))}"
|
|
|
|
|
|
|
|
endpoint_bindings = [{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.oam-space
|
2024-05-06 16:44:43 +00:00
|
|
|
},{
|
|
|
|
endpoint = "amqp"
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.internal-space
|
2024-05-06 16:44:43 +00:00
|
|
|
},{
|
|
|
|
endpoint = "cluster"
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.internal-space
|
2024-05-06 16:44:43 +00:00
|
|
|
}]
|
|
|
|
|
|
|
|
config = {
|
2024-05-07 19:23:43 +00:00
|
|
|
source = var.openstack-origin
|
2024-05-06 16:44:43 +00:00
|
|
|
min-cluster-size = "3"
|
|
|
|
cluster-partition-handling = "pause_minority"
|
|
|
|
}
|
|
|
|
}
|