Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/volumes'
Browse files Browse the repository at this point in the history
  • Loading branch information
mboisson committed Mar 13, 2024
2 parents fa96b21 + 64bd4bd commit 3d4b8ab
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
5 changes: 4 additions & 1 deletion aws/infrastructure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ locals {
for pv_key, pv_values in var.volumes:
pv_key => {
for name, specs in pv_values:
name => ["/dev/disk/by-id/*${replace(aws_ebs_volume.volumes["${x}-${pv_key}-${name}"].id, "-", "")}"]
name => merge(
{ glob = "/dev/disk/by-id/*${replace(aws_ebs_volume.volumes["${x}-${pv_key}-${name}"].id, "-", "")}" },
specs,
)
} if contains(values.tags, pv_key)
} : {}
}
Expand Down
5 changes: 4 additions & 1 deletion azure/infrastructure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ locals {
for pv_key, pv_values in var.volumes:
pv_key => {
for name, specs in pv_values:
name => ["/dev/disk/azure/scsi1/lun${index(module.design.volume_per_instance[x], replace(pv_key, "${x}-", ""))}"]
name => merge(
{ glob = "/dev/disk/azure/scsi1/lun${index(module.design.volume_per_instance[x], replace(pv_key, "${x}-", ""))}" },
specs,
)
} if contains(values.tags, pv_key)
} : {}
}
Expand Down
5 changes: 4 additions & 1 deletion gcp/infrastructure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ locals {
for pv_key, pv_values in var.volumes:
pv_key => {
for name, specs in pv_values:
name => ["/dev/disk/by-id/google-${var.cluster_name}-${x}-${pv_key}-${name}"]
name => merge(
{ glob = "/dev/disk/by-id/google-${var.cluster_name}-${x}-${pv_key}-${name}"},
specs,
)
} if contains(values.tags, pv_key)
} : {}
}
Expand Down
6 changes: 5 additions & 1 deletion openstack/infrastructure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ resource "openstack_blockstorage_volume_v3" "volumes" {
size = each.value.size
volume_type = lookup(each.value, "type", null)
snapshot_id = lookup(each.value, "snapshot", null)
enable_online_resize = lookup(each.value, "enable_resize", false)
}

resource "openstack_compute_volume_attach_v2" "attachments" {
Expand Down Expand Up @@ -129,7 +130,10 @@ locals {
for pv_key, pv_values in var.volumes:
pv_key => {
for name, specs in pv_values:
name => ["/dev/disk/by-id/*${substr(openstack_blockstorage_volume_v3.volumes["${x}-${pv_key}-${name}"].id, 0, 20)}"]
name => merge(
{ glob = "/dev/disk/by-id/*${substr(openstack_blockstorage_volume_v3.volumes["${x}-${pv_key}-${name}"].id, 0, 20)}" },
specs,
)
} if contains(values.tags, pv_key)
} : {}
}
Expand Down

0 comments on commit 3d4b8ab

Please sign in to comment.