Skip to content

Commit

Permalink
add var.registry
Browse files Browse the repository at this point in the history
  • Loading branch information
Annie Hedgpeth committed Nov 17, 2023
1 parent 44c06d0 commit c745f0f
Show file tree
Hide file tree
Showing 17 changed files with 64 additions and 44 deletions.
8 changes: 5 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}

Expand Down
5 changes: 3 additions & 2 deletions tests/private-active-active/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
3 changes: 2 additions & 1 deletion tests/private-active-active/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
8 changes: 4 additions & 4 deletions tests/private-active-active/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
5 changes: 3 additions & 2 deletions tests/private-tcp-active-active/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
3 changes: 2 additions & 1 deletion tests/private-tcp-active-active/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}

8 changes: 4 additions & 4 deletions tests/private-tcp-active-active/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
3 changes: 3 additions & 0 deletions tests/public-active-active/locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
locals {
registry = "quay.io"
}
6 changes: 3 additions & 3 deletions tests/public-active-active/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"
}
8 changes: 4 additions & 4 deletions tests/public-active-active/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
2 changes: 2 additions & 0 deletions tests/standalone-external-rhel8-worker/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
5 changes: 3 additions & 2 deletions tests/standalone-external-rhel8-worker/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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}"
}


Expand Down
8 changes: 4 additions & 4 deletions tests/standalone-external-rhel8-worker/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
9 changes: 5 additions & 4 deletions tests/standalone-mounted-disk/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
3 changes: 2 additions & 1 deletion tests/standalone-mounted-disk/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}


Expand Down
8 changes: 4 additions & 4 deletions tests/standalone-mounted-disk/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
16 changes: 11 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -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."
Expand Down Expand Up @@ -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" {
Expand Down

0 comments on commit c745f0f

Please sign in to comment.