Arif Ali
1ca320e672
* Now with cross-model relations * Added infra and controller model * Fixed lma model * Updated variables and linking to model juju_model resource instead
45 lines
1.0 KiB
HCL
45 lines
1.0 KiB
HCL
resource "juju_machine" "mysql" {
|
|
count = var.num_units
|
|
model = juju_model.openstack.name
|
|
placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids[count.index]].machine_id])
|
|
constraints = "spaces=oam"
|
|
}
|
|
|
|
resource "juju_application" "mysql-innodb-cluster" {
|
|
name = "mysql-innodb-cluster"
|
|
|
|
model = juju_model.openstack.name
|
|
|
|
charm {
|
|
name = "mysql-innodb-cluster"
|
|
channel = var.mysql-channel
|
|
base = var.default-base
|
|
}
|
|
|
|
units = var.num_units
|
|
|
|
placement = "${join(",", sort([
|
|
for res in juju_machine.mysql :
|
|
res.machine_id
|
|
]))}"
|
|
|
|
endpoint_bindings = [{
|
|
space = var.oam-space
|
|
},{
|
|
endpoint = "cluster"
|
|
space = var.internal-space
|
|
},{
|
|
endpoint = "db-router"
|
|
space = var.internal-space
|
|
}]
|
|
|
|
config = {
|
|
source = var.openstack-origin
|
|
wait-timeout = "3600"
|
|
enable-binlogs = "false"
|
|
snapd_refresh = "max"
|
|
max-connections = var.mysql-connections
|
|
tuning-level = var.mysql-tuning-level
|
|
}
|
|
}
|