2023-10-27 17:18:20 +00:00
|
|
|
resource "juju_application" "ceph-osd" {
|
|
|
|
name = "ceph-osd"
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2023-10-27 17:18:20 +00:00
|
|
|
|
|
|
|
charm {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = "ceph-osd"
|
2024-05-12 20:58:33 +00:00
|
|
|
channel = var.ceph-channel
|
2023-10-27 17:18:20 +00:00
|
|
|
}
|
|
|
|
|
2024-05-12 13:43:53 +00:00
|
|
|
units = length(var.compute_ids)
|
|
|
|
|
|
|
|
placement = "${join(",", sort([
|
2024-05-13 07:12:59 +00:00
|
|
|
for index in var.compute_ids :
|
2024-05-12 13:43:53 +00:00
|
|
|
juju_machine.all_machines[index].machine_id
|
|
|
|
]))}"
|
2023-10-27 17:18:20 +00:00
|
|
|
|
|
|
|
config = {
|
2024-05-07 19:23:43 +00:00
|
|
|
osd-devices = var.osd-devices
|
|
|
|
source = var.openstack-origin
|
2023-10-27 17:18:20 +00:00
|
|
|
aa-profile-mode = "complain"
|
2023-11-29 08:13:37 +00:00
|
|
|
customize-failure-domain = "true"
|
2024-05-07 19:23:43 +00:00
|
|
|
autotune = "false"
|
|
|
|
bluestore = "true"
|
|
|
|
#osd-encrypt = "true"
|
2024-05-06 16:44:43 +00:00
|
|
|
#osd-encrypt-keymanager = "vault"
|
2023-10-27 17:18:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-12 13:43:53 +00:00
|
|
|
resource "juju_machine" "ceph-mon" {
|
|
|
|
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-03 09:09:36 +00:00
|
|
|
constraints = "spaces=oam,ceph-access,ceph-replica"
|
2024-05-02 20:44:41 +00:00
|
|
|
}
|
|
|
|
|
2023-10-27 17:18:20 +00:00
|
|
|
resource "juju_application" "ceph-mon" {
|
|
|
|
name = "ceph-mon"
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2023-10-27 17:18:20 +00:00
|
|
|
|
|
|
|
charm {
|
|
|
|
name = "ceph-mon"
|
2024-05-12 13:43:53 +00:00
|
|
|
channel = var.ceph-channel
|
2023-10-27 17:18:20 +00:00
|
|
|
}
|
|
|
|
|
2024-05-12 13:43:53 +00:00
|
|
|
units = var.num_units
|
2023-10-27 17:18:20 +00:00
|
|
|
|
2024-05-12 13:43:53 +00:00
|
|
|
placement = "${join(",", sort([
|
2024-05-12 20:58:33 +00:00
|
|
|
for res in juju_machine.ceph-mon :
|
|
|
|
res.machine_id
|
2024-05-02 20:44:41 +00:00
|
|
|
]))}"
|
|
|
|
|
|
|
|
endpoint_bindings = [{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.oam-space
|
2024-05-02 20:44:41 +00:00
|
|
|
},{
|
|
|
|
endpoint = "public"
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.ceph-public-space
|
2024-05-02 20:44:41 +00:00
|
|
|
},{
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "osd"
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.ceph-public-space
|
2024-05-02 20:44:41 +00:00
|
|
|
},{
|
2024-05-06 16:44:43 +00:00
|
|
|
endpoint = "client"
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.ceph-public-space
|
2024-05-06 16:44:43 +00:00
|
|
|
},{
|
2024-05-02 20:44:41 +00:00
|
|
|
endpoint = "admin"
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.ceph-public-space
|
2024-05-02 20:44:41 +00:00
|
|
|
},{
|
|
|
|
endpoint = "cluster"
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.ceph-cluster-space
|
2024-05-02 20:44:41 +00:00
|
|
|
}]
|
|
|
|
|
2023-10-27 17:18:20 +00:00
|
|
|
config = {
|
2024-05-07 19:23:43 +00:00
|
|
|
expected-osd-count = var.expected-osd-count
|
|
|
|
source = var.openstack-origin
|
|
|
|
monitor-count = var.expected-mon-count
|
2023-10-27 17:18:20 +00:00
|
|
|
customize-failure-domain = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-12 13:43:53 +00:00
|
|
|
resource "juju_machine" "ceph-rgw" {
|
|
|
|
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-03 09:09:36 +00:00
|
|
|
constraints = "spaces=oam,ceph-access"
|
2024-05-02 20:44:41 +00:00
|
|
|
}
|
|
|
|
|
2023-10-27 17:18:20 +00:00
|
|
|
resource "juju_application" "ceph-radosgw" {
|
|
|
|
name = "ceph-radosgw"
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2023-10-27 17:18:20 +00:00
|
|
|
|
|
|
|
charm {
|
|
|
|
name = "ceph-radosgw"
|
2024-05-12 13:43:53 +00:00
|
|
|
channel = var.ceph-channel
|
2023-10-27 17:18:20 +00:00
|
|
|
}
|
|
|
|
|
2024-05-12 13:43:53 +00:00
|
|
|
units = var.num_units
|
2023-10-27 17:18:20 +00:00
|
|
|
|
2024-05-12 13:43:53 +00:00
|
|
|
placement = "${join(",", sort([
|
2024-05-12 20:58:33 +00:00
|
|
|
for res in juju_machine.ceph-rgw :
|
|
|
|
res.machine_id
|
2024-05-02 20:44:41 +00:00
|
|
|
]))}"
|
|
|
|
|
2024-05-03 09:09:36 +00:00
|
|
|
endpoint_bindings = [{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.oam-space
|
2024-05-03 09:09:36 +00:00
|
|
|
},{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.public-space
|
2024-05-03 09:09:36 +00:00
|
|
|
endpoint = "public"
|
|
|
|
},{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.admin-space
|
2024-05-03 09:09:36 +00:00
|
|
|
endpoint = "admin"
|
|
|
|
},{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.internal-space
|
2024-05-03 09:09:36 +00:00
|
|
|
endpoint = "internal"
|
|
|
|
},{
|
2024-05-07 19:23:43 +00:00
|
|
|
space = var.ceph-public-space
|
2024-05-03 09:09:36 +00:00
|
|
|
endpoint = "mon"
|
|
|
|
}]
|
|
|
|
|
2023-10-27 17:18:20 +00:00
|
|
|
config = {
|
2024-05-07 19:23:43 +00:00
|
|
|
source = var.openstack-origin
|
|
|
|
vip = var.vips["radosgw"]
|
|
|
|
operator-roles = "Member,admin"
|
|
|
|
region = var.openstack-region
|
2023-11-29 08:13:37 +00:00
|
|
|
os-admin-hostname = "swift-internal.example.com"
|
|
|
|
os-internal-hostname = "swift-internal.example.com"
|
|
|
|
os-public-hostname = "swift.example.com"
|
2023-10-27 17:18:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_application" "hacluster-radosgw" {
|
|
|
|
name = "hacluster-radosgw"
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2023-10-27 17:18:20 +00:00
|
|
|
|
|
|
|
charm {
|
|
|
|
name = "hacluster"
|
2024-05-12 13:43:53 +00:00
|
|
|
channel = var.hacluster-channel
|
2023-10-27 17:18:20 +00:00
|
|
|
}
|
|
|
|
|
2024-05-02 20:44:41 +00:00
|
|
|
units = 0
|
2023-10-27 17:18:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "osd-mon" {
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2023-10-27 17:18:20 +00:00
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.ceph-osd.name
|
2023-10-27 17:18:20 +00:00
|
|
|
endpoint = "mon"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.ceph-mon.name
|
2023-10-27 17:18:20 +00:00
|
|
|
endpoint = "osd"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "rgw-mon" {
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2023-10-27 17:18:20 +00:00
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.ceph-radosgw.name
|
2023-10-27 17:18:20 +00:00
|
|
|
endpoint = "mon"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.ceph-mon.name
|
2023-10-27 17:18:20 +00:00
|
|
|
endpoint = "radosgw"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "juju_integration" "rgw-ha" {
|
|
|
|
|
2024-05-07 16:12:07 +00:00
|
|
|
model = var.model-name
|
2023-10-27 17:18:20 +00:00
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.ceph-radosgw.name
|
2023-10-27 17:18:20 +00:00
|
|
|
endpoint = "ha"
|
|
|
|
}
|
|
|
|
|
|
|
|
application {
|
2024-05-07 19:23:43 +00:00
|
|
|
name = juju_application.hacluster-radosgw.name
|
2023-10-27 17:18:20 +00:00
|
|
|
endpoint = "ha"
|
|
|
|
}
|
|
|
|
}
|
2024-05-06 16:44:43 +00:00
|
|
|
|
|
|
|
resource "juju_integration" "rgw-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.ceph-radosgw.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"
|
|
|
|
}
|
|
|
|
}
|