2024-05-06 16:44:43 +00:00
|
|
|
resource "juju_machine" "keystone-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" "keystone-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" "keystone-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" "keystone" {
|
|
|
|
name = "keystone"
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
charm {
|
|
|
|
name = "keystone"
|
2024-05-07 19:23:43 +00:00
|
|
|
channel = var.openstack-channel
|
2024-05-06 16:44:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
units = 3
|
|
|
|
|
|
|
|
placement = "${join(",",sort([
|
|
|
|
juju_machine.keystone-1.machine_id,
|
|
|
|
juju_machine.keystone-2.machine_id,
|
|
|
|
juju_machine.keystone-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
|
|
|
},{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.public-space
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "public"
|
|
|
|
},{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.admin-space
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "admin"
|
|
|
|
},{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.internal-space
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "internal"
|
|
|
|
},{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.internal-space
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "shared-db"
|
|
|
|
}]
|
|
|
|
|
|
|
|
config = {
|
2024-05-07 19:23:43 +00:00
|
|
|
worker-multiplier = var.worker-multiplier
|
|
|
|
openstack-origin = var.openstack-origin
|
|
|
|
vip = var.vips["keystone"]
|
|
|
|
region = var.openstack-region
|
2024-05-06 16:44:43 +00:00
|
|
|
preferred-api-version = "3"
|
2024-05-07 19:23:43 +00:00
|
|
|
token-provider = "fernet"
|
|
|
|
admin-password = "openstack"
|
2024-05-06 16:44:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_application" "keystone-mysql-router" {
|
|
|
|
name = "keystone-mysql-router"
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
charm {
|
|
|
|
name = "mysql-router"
|
|
|
|
channel = "8.0/stable"
|
|
|
|
}
|
|
|
|
|
|
|
|
units = 0
|
|
|
|
|
|
|
|
endpoint_bindings = [{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.oam-space
|
2024-05-06 16:44:43 +00:00
|
|
|
},{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.internal-space
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "shared-db"
|
|
|
|
},{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.internal-space
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "db-router"
|
|
|
|
}]
|
|
|
|
|
|
|
|
config = {
|
2024-05-07 19:23:43 +00:00
|
|
|
source = var.openstack-origin
|
2024-05-06 16:44:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_application" "hacluster-keystone" {
|
|
|
|
name = "hacluster-keystone"
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
charm {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = "hacluster"
|
|
|
|
channel = "2.0.3/stable"
|
2024-05-06 16:44:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
units = 0
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "keystone-ha" {
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.keystone.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "ha"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.hacluster-keystone.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "ha"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "keystone-mysql" {
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.keystone.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "shared-db"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.keystone-mysql-router.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "shared-db"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "keystone-db" {
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.keystone-mysql-router.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "db-router"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.mysql-innodb-cluster.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "db-router"
|
|
|
|
}
|
|
|
|
}
|