2024-05-12 13:43:53 +00:00
|
|
|
resource "juju_machine" "mysql" {
|
|
|
|
count = var.num_units
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.name
|
2024-05-12 13:43:53 +00:00
|
|
|
placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids[count.index]].machine_id])
|
2024-05-06 16:44:43 +00:00
|
|
|
constraints = "spaces=oam"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_application" "mysql-innodb-cluster" {
|
|
|
|
name = "mysql-innodb-cluster"
|
|
|
|
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
charm {
|
|
|
|
name = "mysql-innodb-cluster"
|
2024-05-07 19:23:43 +00:00
|
|
|
channel = var.mysql-channel
|
|
|
|
base = var.default-base
|
2024-05-06 16:44:43 +00:00
|
|
|
}
|
|
|
|
|
2024-05-12 13:43:53 +00:00
|
|
|
units = var.num_units
|
2024-05-06 16:44:43 +00:00
|
|
|
|
2024-05-12 13:43:53 +00:00
|
|
|
placement = "${join(",", sort([
|
2024-05-12 20:58:33 +00:00
|
|
|
for res in juju_machine.mysql :
|
|
|
|
res.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 = "cluster"
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.internal-space
|
2024-05-06 16:44:43 +00:00
|
|
|
},{
|
|
|
|
endpoint = "db-router"
|
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
|
|
|
|
wait-timeout = "3600"
|
|
|
|
enable-binlogs = "false"
|
|
|
|
snapd_refresh = "max"
|
2024-05-06 16:44:43 +00:00
|
|
|
max-connections = var.mysql-connections
|
2024-05-07 19:23:43 +00:00
|
|
|
tuning-level = var.mysql-tuning-level
|
2024-05-06 16:44:43 +00:00
|
|
|
}
|
|
|
|
}
|