2024-05-12 13:43:53 +00:00
|
|
|
resource "juju_machine" "cinder" {
|
|
|
|
count = var.num_units
|
2024-05-07 19:23:43 +00:00
|
|
|
model = var.model-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" "cinder" {
|
|
|
|
name = "cinder"
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
charm {
|
|
|
|
name = "cinder"
|
2024-05-07 19:23:43 +00:00
|
|
|
channel = var.openstack-channel
|
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([
|
|
|
|
for index, _ in slice(var.controller_ids, 0, var.num_units+1) :
|
|
|
|
juju_machine.cinder[index].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 = "public"
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.public-space
|
2024-05-06 16:44:43 +00:00
|
|
|
},{
|
|
|
|
endpoint = "admin"
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.admin-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"
|
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
|
|
|
worker-multiplier = var.worker-multiplier
|
|
|
|
openstack-origin = var.openstack-origin
|
|
|
|
region = var.openstack-region
|
|
|
|
vip = var.vips["cinder"]
|
2024-05-06 16:44:43 +00:00
|
|
|
use-internal-endpoints = "true"
|
2024-05-07 19:23:43 +00:00
|
|
|
block-device = "None"
|
2024-05-06 16:44:43 +00:00
|
|
|
glance-api-version = "2"
|
2024-05-07 19:23:43 +00:00
|
|
|
enabled-services = "api,scheduler,volume"
|
2024-05-06 16:44:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_application" "cinder-ceph" {
|
|
|
|
name = "cinder-ceph"
|
|
|
|
|
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 = "cinder-ceph"
|
|
|
|
channel = var.openstack-channel
|
2024-05-06 16:44:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
units = 0
|
|
|
|
|
|
|
|
config = {
|
|
|
|
restrict-ceph-pools = "false"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
resource "juju_application" "cinder-mysql-router" {
|
|
|
|
name = "cinder-mysql-router"
|
|
|
|
|
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 = "mysql-router"
|
2024-05-12 13:43:53 +00:00
|
|
|
channel = var.mysql-router-channel
|
2024-05-06 16:44:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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 = {
|
|
|
|
source = var.openstack-origin
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_application" "hacluster-cinder" {
|
|
|
|
name = "hacluster-cinder"
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
charm {
|
|
|
|
name = "hacluster"
|
2024-05-12 13:43:53 +00:00
|
|
|
channel = var.hacluster-channel
|
2024-05-06 16:44:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
units = 0
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "cinder-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.cinder.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "ha"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.hacluster-cinder.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "ha"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "cinder-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.cinder.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "shared-db"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.cinder-mysql-router.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "shared-db"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "cinder-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.cinder-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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "cinder-rmq" {
|
|
|
|
|
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.cinder.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "amqp"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.rabbitmq-server.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "amqp"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "cinder-keystone" {
|
|
|
|
|
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.cinder.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "identity-service"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.keystone.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "identity-service"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "cinder-ceph" {
|
|
|
|
|
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.cinder.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "ceph"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.ceph-mon.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "client"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "cinder-ceph-mon" {
|
|
|
|
|
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.cinder-ceph.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "ceph"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.ceph-mon.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "client"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "cinder-ceph-cinder" {
|
|
|
|
|
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.cinder-ceph.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "storage-backend"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.cinder.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "storage-backend"
|
|
|
|
}
|
|
|
|
}
|