Skip to content

Commit

Permalink
Replace list of glob by single glob and add size to volume specs
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd-ntrf committed Feb 28, 2024
1 parent ac833e6 commit 8a47f2b
Show file tree
Hide file tree
Showing 4 changed files with 16 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 @@ -200,7 +200,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 => {
glob = "/dev/disk/by-id/*${replace(aws_ebs_volume.volumes["${x}-${pv_key}-${name}"].id, "-", "")}"
size = specs.size
}
} 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 @@ -163,7 +163,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 => {
glob = "/dev/disk/azure/scsi1/lun${index(module.design.volume_per_instance[x], replace(pv_key, "${x}-", ""))}"
size = specs.size
}
} 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 @@ -173,7 +173,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 => {
glob = "/dev/disk/by-id/google-${var.cluster_name}-${x}-${pv_key}-${name}"
size = specs.size
}
} if contains(values.tags, pv_key)
} : {}
}
Expand Down
5 changes: 4 additions & 1 deletion openstack/infrastructure.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,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 => {
glob = "/dev/disk/by-id/*${substr(openstack_blockstorage_volume_v3.volumes["${x}-${pv_key}-${name}"].id, 0, 20)}"
size = specs.size
}
} if contains(values.tags, pv_key)
} : {}
}
Expand Down

0 comments on commit 8a47f2b

Please sign in to comment.