2024-05-06 16:44:43 +00:00
|
|
|
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])
|
2024-05-06 16:44:43 +00:00
|
|
|
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])
|
2024-05-06 16:44:43 +00:00
|
|
|
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])
|
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"
|
|
|
|
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
|
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"
|
|
|
|
}
|
|
|
|
}
|