diff --git a/main.tf b/main.tf index a61f4deb..c2b40ce9 100644 --- a/main.tf +++ b/main.tf @@ -166,7 +166,7 @@ module "docker_compose_config" { # User data / cloud init used to install and configure TFE on instance(s) using Flexible Deployment Options # ---------------------------------------------------------------------------------------------------------- module "tfe_init_fdo" { - source = "git::https://github.com/hashicorp/terraform-random-tfe-utility//modules/tfe_init?ref=main" + source = "git::https://github.com/hashicorp/terraform-random-tfe-utility//modules/tfe_init?ref=ah/TF-10844-registry" count = var.is_replicated_deployment ? 0 : 1 cloud = "google" @@ -185,8 +185,10 @@ module "tfe_init_fdo" { proxy_port = var.proxy_port extra_no_proxy = local.extra_no_proxy - registry_username = var.registry_username - registry_password = var.registry_password + registry = var.registry + registry_password = var.registry == "images.releases.hashicorp.com" ? var.hc_license : var.registry_password + registry_username = var.registry_username + docker_compose_yaml = module.docker_compose_config[0].docker_compose_yaml } diff --git a/tests/private-active-active/locals.tf b/tests/private-active-active/locals.tf index 257d872f..0882da23 100644 --- a/tests/private-active-active/locals.tf +++ b/tests/private-active-active/locals.tf @@ -5,12 +5,13 @@ locals { name = "${random_pet.main.id}-proxy" labels = { oktodelete = "true" - terraform = "true" department = "engineering" product = "terraform-enterprise" repository = "terraform-google-terraform-enterprise" description = "private-active-active" environment = "test" - team = "tf-on-prem" + team = "terraform-enterprise" } + + registry = "quay.io" } diff --git a/tests/private-active-active/main.tf b/tests/private-active-active/main.tf index 29221a48..91fc4f01 100644 --- a/tests/private-active-active/main.tf +++ b/tests/private-active-active/main.tf @@ -68,7 +68,8 @@ module "tfe" { http_port = 8080 https_port = 8443 license_reporting_opt_out = true + registry = local.registry registry_password = var.registry_password registry_username = var.registry_username - tfe_image = "quay.io/hashicorp/terraform-enterprise:${var.tfe_image_tag}" + tfe_image = "${local.registry}/hashicorp/terraform-enterprise:${var.tfe_image_tag}" } diff --git a/tests/private-active-active/variables.tf b/tests/private-active-active/variables.tf index bbac5694..1db4b5c4 100644 --- a/tests/private-active-active/variables.tf +++ b/tests/private-active-active/variables.tf @@ -31,16 +31,16 @@ variable "license_file" { description = "The local path to the Terraform Enterprise license to be provided by CI." } -variable "registry_username" { +variable "registry_password" { default = null type = string - description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." + description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." } -variable "registry_password" { +variable "registry_username" { default = null type = string - description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." + description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." } variable "tfe_hostname" { diff --git a/tests/private-tcp-active-active/locals.tf b/tests/private-tcp-active-active/locals.tf index 60702c69..d9ceb5e6 100644 --- a/tests/private-tcp-active-active/locals.tf +++ b/tests/private-tcp-active-active/locals.tf @@ -5,12 +5,13 @@ locals { name = "${random_pet.main.id}-proxy" labels = { oktodelete = "true" - terraform = "true" department = "engineering" product = "terraform-enterprise" repository = "terraform-google-terraform-enterprise" description = "private-tcp-active-active" environment = "test" - team = "tf-on-prem" + team = "terraform-enterprise" } + + registry = "quay.io" } diff --git a/tests/private-tcp-active-active/main.tf b/tests/private-tcp-active-active/main.tf index 76cac816..993f5b65 100644 --- a/tests/private-tcp-active-active/main.tf +++ b/tests/private-tcp-active-active/main.tf @@ -72,8 +72,9 @@ module "tfe" { http_port = 8080 https_port = 8443 license_reporting_opt_out = true + registry = local.registry registry_password = var.registry_password registry_username = var.registry_username - tfe_image = "quay.io/hashicorp/terraform-enterprise:${var.tfe_image_tag}" + tfe_image = "${local.registry}/hashicorp/terraform-enterprise:${var.tfe_image_tag}" } diff --git a/tests/private-tcp-active-active/variables.tf b/tests/private-tcp-active-active/variables.tf index bbac5694..1db4b5c4 100644 --- a/tests/private-tcp-active-active/variables.tf +++ b/tests/private-tcp-active-active/variables.tf @@ -31,16 +31,16 @@ variable "license_file" { description = "The local path to the Terraform Enterprise license to be provided by CI." } -variable "registry_username" { +variable "registry_password" { default = null type = string - description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." + description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." } -variable "registry_password" { +variable "registry_username" { default = null type = string - description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." + description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." } variable "tfe_hostname" { diff --git a/tests/public-active-active/locals.tf b/tests/public-active-active/locals.tf new file mode 100644 index 00000000..b2b66592 --- /dev/null +++ b/tests/public-active-active/locals.tf @@ -0,0 +1,3 @@ +locals { + registry = "quay.io" +} \ No newline at end of file diff --git a/tests/public-active-active/main.tf b/tests/public-active-active/main.tf index 19ffbee2..b2995422 100644 --- a/tests/public-active-active/main.tf +++ b/tests/public-active-active/main.tf @@ -49,13 +49,12 @@ module "tfe" { labels = { oktodelete = "true" - terraform = "true" department = "engineering" product = "terraform-enterprise" repository = "terraform-google-terraform-enterprise" description = "public-active-active" environment = "test" - team = "tf-on-prem" + team = "terraform-enterprise" } # FDO Specific Values @@ -64,7 +63,8 @@ module "tfe" { http_port = 8080 https_port = 8443 license_reporting_opt_out = true + registry = local.registry registry_password = var.registry_password registry_username = var.registry_username - tfe_image = "quay.io/hashicorp/terraform-enterprise:${var.tfe_image_tag}" + tfe_image = "${local.registry}/hashicorp/terraform-enterprise:${var.tfe_image_tag}" } diff --git a/tests/public-active-active/variables.tf b/tests/public-active-active/variables.tf index 941c18ad..371394c5 100644 --- a/tests/public-active-active/variables.tf +++ b/tests/public-active-active/variables.tf @@ -40,16 +40,16 @@ variable "license_file" { description = "The local path to the Terraform Enterprise license to be provided by CI." } -variable "registry_username" { +variable "registry_password" { default = null type = string - description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." + description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." } -variable "registry_password" { +variable "registry_username" { default = null type = string - description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." + description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." } variable "tfe_hostname" { diff --git a/tests/standalone-external-rhel8-worker/locals.tf b/tests/standalone-external-rhel8-worker/locals.tf index 15fc6c1f..a04c8fc6 100644 --- a/tests/standalone-external-rhel8-worker/locals.tf +++ b/tests/standalone-external-rhel8-worker/locals.tf @@ -10,5 +10,7 @@ locals { "hc-50fbe27799384c96925f18084d7" = "us-west1" "tfe-modules-ci-001" = "us-east4" } + + registry = "quay.io" repository_location = local.project_regions[data.google_project.project.project_id] } \ No newline at end of file diff --git a/tests/standalone-external-rhel8-worker/main.tf b/tests/standalone-external-rhel8-worker/main.tf index fe362905..66f67bf6 100644 --- a/tests/standalone-external-rhel8-worker/main.tf +++ b/tests/standalone-external-rhel8-worker/main.tf @@ -52,7 +52,7 @@ module "tfe" { oktodelete = "true" product = "terraform-enterprise" repository = "hashicorp-terraform-google-terraform-enterprise" - team = "terraform-enterprise-on-prem" + team = "terraform-enterprise" } load_balancer = "PUBLIC" operational_mode = "external" @@ -71,9 +71,10 @@ module "tfe" { http_port = 8080 https_port = 8443 license_reporting_opt_out = true + registry = local.registry registry_password = var.registry_password registry_username = var.registry_username - tfe_image = "quay.io/hashicorp/terraform-enterprise:${var.tfe_image_tag}" + tfe_image = "${local.registry}/hashicorp/terraform-enterprise:${var.tfe_image_tag}" } diff --git a/tests/standalone-external-rhel8-worker/variables.tf b/tests/standalone-external-rhel8-worker/variables.tf index 84e613cb..2cb761c6 100644 --- a/tests/standalone-external-rhel8-worker/variables.tf +++ b/tests/standalone-external-rhel8-worker/variables.tf @@ -31,16 +31,16 @@ variable "license_file" { description = "The local path to the Terraform Enterprise license to be provided by CI." } -variable "registry_username" { +variable "registry_password" { default = null type = string - description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." + description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." } -variable "registry_password" { +variable "registry_username" { default = null type = string - description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." + description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." } variable "tfe_hostname" { diff --git a/tests/standalone-mounted-disk/locals.tf b/tests/standalone-mounted-disk/locals.tf index 2ad74287..5d03a2a5 100644 --- a/tests/standalone-mounted-disk/locals.tf +++ b/tests/standalone-mounted-disk/locals.tf @@ -4,14 +4,15 @@ locals { labels = { department = "engineering" - description = "standalone-mounted-disk-scenario-deployed-from-circleci" + description = "standalone-mounted-disk-scenario" environment = random_pet.main.id oktodelete = "true" product = "terraform-enterprise" repository = "hashicorp-terraform-google-terraform-enterprise" - team = "terraform-enterprise-on-prem" - terraform = "true" + team = "terraform-enterprise" } - ssh_user = "ubuntu" + enable_ssh_config = var.license_file == null ? 0 : 1 + registry = "quay.io" + ssh_user = "ubuntu" } diff --git a/tests/standalone-mounted-disk/main.tf b/tests/standalone-mounted-disk/main.tf index 2fbcd331..68bbb216 100644 --- a/tests/standalone-mounted-disk/main.tf +++ b/tests/standalone-mounted-disk/main.tf @@ -62,9 +62,10 @@ module "tfe" { http_port = 8080 https_port = 8443 license_reporting_opt_out = true + registry = local.registry registry_password = var.registry_password registry_username = var.registry_username - tfe_image = "quay.io/hashicorp/terraform-enterprise:${var.tfe_image_tag}" + tfe_image = "${local.registry}/hashicorp/terraform-enterprise:${var.tfe_image_tag}" } diff --git a/tests/standalone-mounted-disk/variables.tf b/tests/standalone-mounted-disk/variables.tf index bbac5694..1db4b5c4 100644 --- a/tests/standalone-mounted-disk/variables.tf +++ b/tests/standalone-mounted-disk/variables.tf @@ -31,16 +31,16 @@ variable "license_file" { description = "The local path to the Terraform Enterprise license to be provided by CI." } -variable "registry_username" { +variable "registry_password" { default = null type = string - description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." + description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." } -variable "registry_password" { +variable "registry_username" { default = null type = string - description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." + description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." } variable "tfe_hostname" { diff --git a/variables.tf b/variables.tf index ef7db695..2f624323 100644 --- a/variables.tf +++ b/variables.tf @@ -439,10 +439,10 @@ variable "redis_use_tls" { type = bool } -variable "registry_username" { - default = null +variable "registry" { + default = "images.releases.hashicorp.com" type = string - description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." + description = "(Not needed if is_replicated_deployment is true) The docker registry from which to source the terraform_enterprise container images." } variable "registry_password" { @@ -451,6 +451,12 @@ variable "registry_password" { description = "(Not needed if is_replicated_deployment is true) The password for the docker registry from which to source the terraform_enterprise container images." } +variable "registry_username" { + default = null + type = string + description = "(Not needed if is_replicated_deployment is true) The username for the docker registry from which to source the terraform_enterprise container images." +} + variable "release_sequence" { default = null description = "Release sequence of Terraform Enterprise to install." @@ -482,9 +488,9 @@ variable "ssl_private_key_secret" { } variable "tfe_image" { - default = "quay.io/hashicorp/terraform-enterprise:latest" + default = "images.releases.hashicorp.com/hashicorp/terraform-enterprise:v202311-1" type = string - description = "(Not needed if is_replicated_deployment is true) The registry path, image name, and image version (e.g. \"quay.io/hashicorp/terraform-enterprise:1234567\")" + description = "(Not needed if is_replicated_deployment is true) The registry path, image name, and image version." } variable "tfe_license_bootstrap_airgap_package_path" {