2024-05-12 20:58:33 +00:00
|
|
|
resource "juju_machine" "vault" {
|
|
|
|
count = var.num_units
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.name
|
2024-05-13 07:12:59 +00:00
|
|
|
placement = join(":",["lxd",juju_machine.all_machines[var.sdn_ids[count.index]].machine_id])
|
2024-05-06 16:44:43 +00:00
|
|
|
constraints = "spaces=oam"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_application" "vault" {
|
|
|
|
name = "vault"
|
|
|
|
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
charm {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = "vault"
|
2024-05-12 13:43:53 +00:00
|
|
|
channel = var.vault_channel
|
2024-05-07 19:23:43 +00:00
|
|
|
base = var.default-base
|
2024-05-06 16:44:43 +00:00
|
|
|
}
|
|
|
|
|
2024-05-12 20:58:33 +00:00
|
|
|
units = var.num_units
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
placement = "${join(",",sort([
|
2024-05-12 20:58:33 +00:00
|
|
|
for res in juju_machine.vault :
|
|
|
|
res.machine_id
|
2024-05-06 16:44:43 +00:00
|
|
|
]))}"
|
|
|
|
|
|
|
|
config = {
|
2024-05-07 19:23:43 +00:00
|
|
|
vip = var.vips["vault"]
|
2024-05-06 16:44:43 +00:00
|
|
|
nagios_context = var.nagios-context
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_application" "vault-mysql-router" {
|
|
|
|
name = "vault-mysql-router"
|
|
|
|
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.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
|
|
|
},{
|
|
|
|
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"
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.internal-space
|
2024-05-06 16:44:43 +00:00
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
config = {
|
|
|
|
source = var.openstack-origin
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_application" "hacluster-vault" {
|
|
|
|
name = "hacluster-vault"
|
|
|
|
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-05-12 20:58:33 +00:00
|
|
|
resource "juju_machine" "etcd" {
|
|
|
|
count = var.num_units
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.name
|
2024-05-13 07:12:59 +00:00
|
|
|
placement = join(":",["lxd",juju_machine.all_machines[var.sdn_ids[count.index]].machine_id])
|
2024-05-06 16:44:43 +00:00
|
|
|
constraints = "spaces=oam"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_application" "etcd" {
|
|
|
|
name = "etcd"
|
|
|
|
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
charm {
|
|
|
|
name = "etcd"
|
2024-05-12 13:43:53 +00:00
|
|
|
channel = var.etcd_channel
|
2024-11-19 22:25:01 +00:00
|
|
|
#revision = var.etcd_revision
|
2024-05-07 19:23:43 +00:00
|
|
|
base = var.default-base
|
2024-05-06 16:44:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
placement = "${join(",",sort([
|
2024-05-12 20:58:33 +00:00
|
|
|
for res in juju_machine.etcd :
|
|
|
|
res.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
|
|
|
},{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.internal-space
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "cluster"
|
|
|
|
},{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.internal-space
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "db"
|
|
|
|
}]
|
|
|
|
|
2024-05-12 13:43:53 +00:00
|
|
|
units = var.num_units
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
config = {
|
|
|
|
channel = "3.2/stable"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_machine" "easyrsa" {
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.name
|
2024-05-07 19:23:43 +00:00
|
|
|
placement = join(":",["lxd",juju_machine.all_machines["402"].machine_id])
|
2024-05-06 16:44:43 +00:00
|
|
|
constraints = "spaces=oam"
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_application" "easyrsa" {
|
|
|
|
name = "easyrsa"
|
|
|
|
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
charm {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = "easyrsa"
|
2024-05-12 13:43:53 +00:00
|
|
|
channel = var.easyrsa_channel
|
2024-05-07 19:23:43 +00:00
|
|
|
base = var.default-base
|
2024-05-06 16:44:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
placement = "${juju_machine.easyrsa.machine_id}"
|
|
|
|
|
2024-05-07 19:23:43 +00:00
|
|
|
endpoint_bindings = [{space = var.oam-space}]
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
units = 1
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "vault-etcd" {
|
|
|
|
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.vault.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "etcd"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.etcd.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "db"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "etcd-easyrsa" {
|
|
|
|
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.etcd.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "certificates"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.easyrsa.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "client"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "vault-ha" {
|
|
|
|
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.vault.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "ha"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.hacluster-vault.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "ha"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "vault-mysql" {
|
|
|
|
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.vault.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "shared-db"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.vault-mysql-router.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "shared-db"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "vault-ceph" {
|
|
|
|
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.vault.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "secrets"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.ceph-osd.name
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "secrets-storage"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "vault-db" {
|
|
|
|
|
2024-11-19 22:25:01 +00:00
|
|
|
model = juju_model.openstack.name
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.vault-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"
|
|
|
|
}
|
|
|
|
}
|