terraform/juju/home-maas/05-glance.tf

206 lines
3.9 KiB
Terraform
Raw Normal View History

resource "juju_machine" "glance-1" {
2024-05-07 19:23:43 +00:00
model = var.model-name
placement = join(":",["lxd",juju_machine.all_machines["100"].machine_id])
constraints = "spaces=oam"
}
resource "juju_machine" "glance-2" {
2024-05-07 19:23:43 +00:00
model = var.model-name
placement = join(":",["lxd",juju_machine.all_machines["101"].machine_id])
constraints = "spaces=oam"
}
resource "juju_machine" "glance-3" {
2024-05-07 19:23:43 +00:00
model = var.model-name
placement = join(":",["lxd",juju_machine.all_machines["102"].machine_id])
constraints = "spaces=oam"
}
resource "juju_application" "glance" {
name = "glance"
model = var.model-name
charm {
name = "glance"
2024-05-07 19:23:43 +00:00
channel = var.openstack-channel
}
units = 3
placement = "${join(",",sort([
juju_machine.glance-1.machine_id,
juju_machine.glance-2.machine_id,
juju_machine.glance-3.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 = {
worker-multiplier = var.worker-multiplier
2024-05-07 19:23:43 +00:00
openstack-origin = var.openstack-origin
region = var.openstack-region
vip = var.vips["glance"]
use-internal-endpoints = "true"
2024-05-07 19:23:43 +00:00
restrict-ceph-pools = "false"
}
}
resource "juju_application" "glance-mysql-router" {
name = "glance-mysql-router"
model = var.model-name
charm {
2024-05-07 19:23:43 +00:00
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-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-glance" {
name = "hacluster-glance"
model = var.model-name
charm {
name = "hacluster"
channel = "2.0.3/stable"
}
units = 0
}
resource "juju_integration" "glance-ha" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.glance.name
endpoint = "ha"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.hacluster-glance.name
endpoint = "ha"
}
}
resource "juju_integration" "glance-mysql" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.glance.name
endpoint = "shared-db"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.glance-mysql-router.name
endpoint = "shared-db"
}
}
resource "juju_integration" "glance-db" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.glance-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" "glance-rmq" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.glance.name
endpoint = "amqp"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.rabbitmq-server.name
endpoint = "amqp"
}
}
resource "juju_integration" "glance-keystone" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.glance.name
endpoint = "identity-service"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.keystone.name
endpoint = "identity-service"
}
}
resource "juju_integration" "glance-ceph" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.glance.name
endpoint = "ceph"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.ceph-mon.name
endpoint = "client"
}
}
resource "juju_integration" "glance-cinder" {
model = var.model-name
application {
2024-05-07 19:23:43 +00:00
name = juju_application.glance.name
endpoint = "image-service"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.cinder.name
endpoint = "image-service"
}
}