Skip to content

Commit

Permalink
rename data to existing_volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
mboisson committed Jan 13, 2025
1 parent 04afc3f commit 78b5330
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openstack/infrastructure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ resource "openstack_blockstorage_volume_v3" "volumes" {
snapshot_id = lookup(each.value, "snapshot", null)
enable_online_resize = lookup(each.value, "enable_resize", false)
}
data "openstack_blockstorage_volume_v3" "volumes" {
data "openstack_blockstorage_volume_v3" "existing_volumes" {
for_each = {
for x, values in module.design.volumes : x => values if contains(keys(values), "volume_id")
}
Expand Down Expand Up @@ -143,7 +143,7 @@ locals {
pv_key => {
for name, specs in pv_values:
name => merge(
{ glob = "/dev/disk/by-id/*${substr(openstack_blockstorage_volume_v3.volumes["${x}-${pv_key}-${name}"].id, 0, 20)}" },
{ glob = try("/dev/disk/by-id/*${substr(openstack_blockstorage_volume_v3.existing_volumes["${x}-${pv_key}-${name}"].id, 0, 20)}", "/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 78b5330

Please sign in to comment.