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

234 lines
5.0 KiB
Terraform
Raw Normal View History

resource "juju_application" "ceph-osd" {
name = "ceph-osd"
model = juju_model.cpe-focal.name
charm {
name = "ceph-osd"
channel = "octopus/stable"
}
units = 8
placement = "${join(",",sort([
juju_machine.all_machines["1000"].machine_id,
juju_machine.all_machines["1001"].machine_id,
juju_machine.all_machines["1002"].machine_id,
juju_machine.all_machines["1003"].machine_id,
juju_machine.all_machines["1004"].machine_id,
juju_machine.all_machines["1005"].machine_id,
juju_machine.all_machines["1006"].machine_id,
juju_machine.all_machines["1007"].machine_id,
]))}"
config = {
osd-devices = var.osd-devices
source = var.openstack-origin
aa-profile-mode = "complain"
customize-failure-domain = "true"
autotune = "false"
bluestore = "true"
#osd-encrypt = "true"
#osd-encrypt-keymanager = "vault"
}
}
2024-05-02 20:44:41 +00:00
resource "juju_machine" "ceph-mon-1" {
model = juju_model.cpe-focal.name
placement = join(":",["lxd",juju_machine.all_machines["100"].machine_id])
constraints = "spaces=oam,ceph-access,ceph-replica"
2024-05-02 20:44:41 +00:00
}
resource "juju_machine" "ceph-mon-2" {
model = juju_model.cpe-focal.name
placement = join(":",["lxd",juju_machine.all_machines["101"].machine_id])
constraints = "spaces=oam,ceph-access,ceph-replica"
2024-05-02 20:44:41 +00:00
}
resource "juju_machine" "ceph-mon-3" {
model = juju_model.cpe-focal.name
placement = join(":",["lxd",juju_machine.all_machines["102"].machine_id])
constraints = "spaces=oam,ceph-access,ceph-replica"
2024-05-02 20:44:41 +00:00
}
resource "juju_application" "ceph-mon" {
name = "ceph-mon"
model = juju_model.cpe-focal.name
charm {
name = "ceph-mon"
channel = "octopus/stable"
}
units = 3
2024-05-02 20:44:41 +00:00
placement = "${join(",",sort([
juju_machine.ceph-mon-1.machine_id,
juju_machine.ceph-mon-2.machine_id,
juju_machine.ceph-mon-3.machine_id,
]))}"
endpoint_bindings = [{
space = "oam"
},{
endpoint = "public"
space = "ceph-access"
},{
endpoint = "osd"
2024-05-02 20:44:41 +00:00
space = "ceph-access"
},{
endpoint = "client"
2024-05-02 20:44:41 +00:00
space = "ceph-access"
},{
2024-05-02 20:44:41 +00:00
endpoint = "admin"
space = "ceph-access"
2024-05-02 20:44:41 +00:00
},{
endpoint = "cluster"
space = "ceph-replica"
2024-05-02 20:44:41 +00:00
}]
config = {
expected-osd-count = 12
source = var.openstack-origin
monitor-count = 3
customize-failure-domain = true
}
}
2024-05-02 20:44:41 +00:00
resource "juju_machine" "ceph-rgw-1" {
model = juju_model.cpe-focal.name
placement = join(":",["lxd",juju_machine.all_machines["100"].machine_id])
constraints = "spaces=oam,ceph-access"
2024-05-02 20:44:41 +00:00
}
resource "juju_machine" "ceph-rgw-2" {
model = juju_model.cpe-focal.name
placement = join(":",["lxd",juju_machine.all_machines["101"].machine_id])
constraints = "spaces=oam,ceph-access"
2024-05-02 20:44:41 +00:00
}
resource "juju_machine" "ceph-rgw-3" {
model = juju_model.cpe-focal.name
placement = join(":",["lxd",juju_machine.all_machines["102"].machine_id])
constraints = "spaces=oam,ceph-access"
2024-05-02 20:44:41 +00:00
}
resource "juju_application" "ceph-radosgw" {
name = "ceph-radosgw"
model = juju_model.cpe-focal.name
charm {
name = "ceph-radosgw"
channel = "octopus/stable"
}
units = 3
2024-05-02 20:44:41 +00:00
placement = "${join(",",sort([
juju_machine.ceph-rgw-1.machine_id,
juju_machine.ceph-rgw-2.machine_id,
juju_machine.ceph-rgw-3.machine_id,
]))}"
endpoint_bindings = [{
space = "oam"
},{
space = "oam"
endpoint = "public"
},{
space = "oam"
endpoint = "admin"
},{
space = "oam"
endpoint = "internal"
},{
space = "ceph-access"
endpoint = "mon"
}]
config = {
source = var.openstack-origin
vip = "10.0.1.224"
operator-roles = "Member,admin"
region = var.openstack-region
os-admin-hostname = "swift-internal.example.com"
os-internal-hostname = "swift-internal.example.com"
os-public-hostname = "swift.example.com"
}
}
resource "juju_application" "hacluster-radosgw" {
name = "hacluster-radosgw"
model = juju_model.cpe-focal.name
charm {
name = "hacluster"
channel = "2.0.3/stable"
}
2024-05-02 20:44:41 +00:00
units = 0
}
resource "juju_integration" "osd-mon" {
model = juju_model.cpe-focal.name
application {
name = juju_application.ceph-osd.name
endpoint = "mon"
}
application {
name = juju_application.ceph-mon.name
endpoint = "osd"
}
}
resource "juju_integration" "rgw-mon" {
model = juju_model.cpe-focal.name
application {
name = juju_application.ceph-radosgw.name
endpoint = "mon"
}
application {
name = juju_application.ceph-mon.name
endpoint = "radosgw"
}
}
resource "juju_integration" "rgw-ha" {
model = juju_model.cpe-focal.name
application {
name = juju_application.ceph-radosgw.name
endpoint = "ha"
}
application {
name = juju_application.hacluster-radosgw.name
endpoint = "ha"
}
}
resource "juju_integration" "rgw-keystone" {
model = juju_model.cpe-focal.name
application {
name = juju_application.ceph-radosgw.name
endpoint = "identity-service"
}
application {
name = juju_application.keystone.name
endpoint = "identity-service"
}
}