58 lines
1.3 KiB
Terraform
58 lines
1.3 KiB
Terraform
|
resource "juju_machine" "mysql-1" {
|
||
|
model = juju_model.cpe-focal.name
|
||
|
placement = join(":",["lxd",juju_machine.all_machines["100"].machine_id])
|
||
|
constraints = "spaces=oam"
|
||
|
}
|
||
|
resource "juju_machine" "mysql-2" {
|
||
|
model = juju_model.cpe-focal.name
|
||
|
placement = join(":",["lxd",juju_machine.all_machines["101"].machine_id])
|
||
|
constraints = "spaces=oam"
|
||
|
}
|
||
|
resource "juju_machine" "mysql-3" {
|
||
|
model = juju_model.cpe-focal.name
|
||
|
placement = join(":",["lxd",juju_machine.all_machines["102"].machine_id])
|
||
|
constraints = "spaces=oam"
|
||
|
}
|
||
|
|
||
|
|
||
|
resource "juju_application" "mysql-innodb-cluster" {
|
||
|
name = "mysql-innodb-cluster"
|
||
|
|
||
|
model = juju_model.cpe-focal.name
|
||
|
|
||
|
charm {
|
||
|
name = "mysql-innodb-cluster"
|
||
|
channel = "8.0/stable"
|
||
|
base = "ubuntu@20.04"
|
||
|
}
|
||
|
|
||
|
units = 3
|
||
|
|
||
|
placement = "${join(",",sort([
|
||
|
juju_machine.mysql-1.machine_id,
|
||
|
juju_machine.mysql-2.machine_id,
|
||
|
juju_machine.mysql-3.machine_id,
|
||
|
]))}"
|
||
|
|
||
|
endpoint_bindings = [{
|
||
|
space = "oam"
|
||
|
},{
|
||
|
endpoint = "cluster"
|
||
|
space = "oam"
|
||
|
},{
|
||
|
endpoint = "db-router"
|
||
|
space = "oam"
|
||
|
}]
|
||
|
|
||
|
config = {
|
||
|
source = var.openstack-origin
|
||
|
#innodb-buffer-pool-size = "16G"
|
||
|
wait-timeout = "3600"
|
||
|
enable-binlogs = "false"
|
||
|
snapd_refresh = "max"
|
||
|
max-connections = var.mysql-connections
|
||
|
tuning-level = var.mysql-tuning-level
|
||
|
}
|
||
|
}
|
||
|
|