terraform/juju/home-maas-focal/05-cinder.tf

230 lines
4.1 KiB
Terraform
Raw Normal View History

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])
constraints = "spaces=oam"
}
resource "juju_application" "cinder" {
name = "cinder"
model = var.model-name
charm {
name = "cinder"
2024-05-07 19:23:43 +00:00
channel = var.openstack-channel
}
2024-05-12 13:43:53 +00:00
units = var.num_units
2024-05-12 13:43:53 +00:00
placement = "${join(",", sort([
for res in juju_machine.cinder :
res.machine_id
]))}"
endpoint_bindings = [{
2024-05-07 19:23:43 +00:00
space = var.oam-space
},{
endpoint = "public"
2024-05-07 19:23:43 +00:00
space = var.public-space
},{
endpoint = "admin"
2024-05-07 19:23:43 +00:00
space = var.admin-space
},{
endpoint = "internal"
2024-05-07 19:23:43 +00:00
space = var.internal-space
},{
endpoint = "shared-db"
2024-05-07 19:23:43 +00:00
space = var.internal-space
}]
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"]
use-internal-endpoints = "true"
2024-05-07 19:23:43 +00:00
block-device = "None"
glance-api-version = "2"
2024-05-07 19:23:43 +00:00
enabled-services = "api,scheduler,volume"
}
}
resource "juju_application" "cinder-ceph" {
name = "cinder-ceph"
model = var.model-name
charm {
2024-05-07 19:23:43 +00:00
name = "cinder-ceph"
channel = var.openstack-channel
}
units = 0
config = {
restrict-ceph-pools = "false"
}
}
resource "juju_application" "cinder-mysql-router" {
name = "cinder-mysql-router"
model = var.model-name
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
}
units = 0
endpoint_bindings = [{
2024-05-07 19:23:43 +00:00
space = var.oam-space
},{
2024-05-07 19:23:43 +00:00
space = var.internal-space
endpoint = "shared-db"
},{
2024-05-07 19:23:43 +00:00
space = var.internal-space
endpoint = "db-router"
}]
config = {
source = var.openstack-origin
}
}
resource "juju_application" "hacluster-cinder" {
name = "hacluster-cinder"
model = var.model-name
charm {
name = "hacluster"
2024-05-12 13:43:53 +00:00
channel = var.hacluster-channel
}
units = 0
}
resource "juju_integration" "cinder-ha" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.cinder.name
endpoint = "ha"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.hacluster-cinder.name
endpoint = "ha"
}
}
resource "juju_integration" "cinder-mysql" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.cinder.name
endpoint = "shared-db"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.cinder-mysql-router.name
endpoint = "shared-db"
}
}
resource "juju_integration" "cinder-db" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.cinder-mysql-router.name
endpoint = "db-router"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.mysql-innodb-cluster.name
endpoint = "db-router"
}
}
resource "juju_integration" "cinder-rmq" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.cinder.name
endpoint = "amqp"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.rabbitmq-server.name
endpoint = "amqp"
}
}
resource "juju_integration" "cinder-keystone" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.cinder.name
endpoint = "identity-service"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.keystone.name
endpoint = "identity-service"
}
}
resource "juju_integration" "cinder-ceph" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.cinder.name
endpoint = "ceph"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.ceph-mon.name
endpoint = "client"
}
}
resource "juju_integration" "cinder-ceph-mon" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.cinder-ceph.name
endpoint = "ceph"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.ceph-mon.name
endpoint = "client"
}
}
resource "juju_integration" "cinder-ceph-cinder" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.cinder-ceph.name
endpoint = "storage-backend"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.cinder.name
endpoint = "storage-backend"
}
}