2023-03-15 16:00:52 +00:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2022-10-17 23:47:37 +00:00
|
|
|
locals {
|
|
|
|
|
|
|
|
// file name extensions for the install packages of vault for the various architectures, distributions and editions
|
|
|
|
package_extensions = {
|
|
|
|
amd64 = {
|
|
|
|
ubuntu = {
|
2022-11-16 19:23:58 +00:00
|
|
|
# "oss" = "-1_amd64.deb"
|
|
|
|
"ent" = "-1_amd64.deb"
|
|
|
|
"ent.hsm" = "-1_amd64.deb"
|
2022-10-17 23:47:37 +00:00
|
|
|
}
|
|
|
|
rhel = {
|
2022-11-16 19:23:58 +00:00
|
|
|
# "oss" = "-1.x86_64.rpm"
|
|
|
|
"ent" = "-1.x86_64.rpm"
|
|
|
|
"ent.hsm" = "-1.x86_64.rpm"
|
2022-10-17 23:47:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
arm64 = {
|
|
|
|
ubuntu = {
|
2022-11-16 19:23:58 +00:00
|
|
|
# "oss" = "-1_arm64.deb"
|
|
|
|
"ent" = "-1_arm64.deb"
|
2022-10-17 23:47:37 +00:00
|
|
|
}
|
|
|
|
rhel = {
|
2022-11-16 19:23:58 +00:00
|
|
|
# "oss" = "-1.aarch64.rpm"
|
|
|
|
"ent" = "-1.aarch64.rpm"
|
2022-10-17 23:47:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-20 18:23:15 +00:00
|
|
|
// product_version --> artifact_version
|
|
|
|
artifact_version = replace(var.product_version, var.edition, "ent")
|
|
|
|
|
2022-10-17 23:47:37 +00:00
|
|
|
// file name prefixes for the install packages of vault for the various distributions and artifact types (package or bundle)
|
|
|
|
artifact_package_release_names = {
|
|
|
|
ubuntu = {
|
|
|
|
"oss" = "vault_"
|
|
|
|
"ent" = "vault-enterprise_",
|
|
|
|
"ent.hsm" = "vault-enterprise-hsm_",
|
|
|
|
},
|
|
|
|
rhel = {
|
|
|
|
"oss" = "vault-"
|
|
|
|
"ent" = "vault-enterprise-",
|
|
|
|
"ent.hsm" = "vault-enterprise-hsm-",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
artifact_types = ["package", "bundle"]
|
|
|
|
|
|
|
|
// edition --> artifact name edition
|
|
|
|
artifact_name_edition = {
|
|
|
|
"oss" = ""
|
|
|
|
"ent" = ""
|
2022-11-16 19:23:58 +00:00
|
|
|
"ent.hsm" = ".hsm"
|
|
|
|
"ent.fips1402" = ".fips1402"
|
|
|
|
"ent.hsm.fips1402" = ".hsm.fips1402"
|
2022-10-17 23:47:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
artifact_name_prefix = var.artifact_type == "package" ? local.artifact_package_release_names[var.distro][var.edition] : "vault_"
|
2022-12-20 18:23:15 +00:00
|
|
|
artifact_name_extension = var.artifact_type == "package" ? local.package_extensions[var.arch][var.distro][var.edition] : "_linux_${var.arch}.zip"
|
|
|
|
artifact_name = var.artifact_type == "package" ? "${local.artifact_name_prefix}${replace(local.artifact_version, "-", "~")}${local.artifact_name_extension}" : "${local.artifact_name_prefix}${var.product_version}${local.artifact_name_extension}"
|
2022-10-17 23:47:37 +00:00
|
|
|
}
|