Skip to content

Commit

Permalink
add registry variable (#243)
Browse files Browse the repository at this point in the history
* add registry variable
  • Loading branch information
anniehedgpeth authored Nov 17, 2023
1 parent 560fe25 commit c2f8d87
Show file tree
Hide file tree
Showing 19 changed files with 67 additions and 53 deletions.
6 changes: 4 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ module "tfe_init_fdo" {
var.network_cidr
]

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
8 changes: 4 additions & 4 deletions tests/private-active-active/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@

locals {
common_tags = {
Terraform = "cloud"
Environment = "${local.friendly_name_prefix}-test-private-active-active"
Description = "Private Active/Active"
Repository = "hashicorp/terraform-azurerm-terraform-enterprise"
Team = "Terraform Enterprise on Prem"
Team = "Terraform Enterprise"
OkToDelete = "True"
}

friendly_name_prefix = random_string.friendly_name.id
resource_group_name = module.private_active_active.resource_group_name
network_proxy_subnet_cidr = "10.0.80.0/20"
proxy_user = "proxyuser"
proxy_port = "3128"
network_proxy_subnet_cidr = "10.0.80.0/20"
registry = "quay.io"
resource_group_name = module.private_active_active.resource_group_name
}
3 changes: 2 additions & 1 deletion tests/private-active-active/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ module "private_active_active" {
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 @@ -55,16 +55,16 @@ variable "proxy_public_ssh_key_secret_name" {
description = "The name of the public SSH key secret for the proxy."
}

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 "resource_group_name_dns" {
Expand Down
8 changes: 4 additions & 4 deletions tests/private-tcp-active-active/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@

locals {
common_tags = {
Terraform = "cloud"
Environment = "${local.friendly_name_prefix}-test-private-tcp-active-active"
Description = "Private TCP Active/Active"
Repository = "hashicorp/terraform-azurerm-terraform-enterprise"
Team = "Terraform Enterprise on Prem"
Team = "Terraform Enterprise"
OkToDelete = "True"
}

friendly_name_prefix = random_string.friendly_name.id
resource_group_name = module.private_tcp_active_active.resource_group_name
network_proxy_subnet_cidr = "10.0.80.0/20"
proxy_user = "proxyuser"
proxy_port = "3128"
network_proxy_subnet_cidr = "10.0.80.0/20"
registry = "quay.io"
resource_group_name = module.private_tcp_active_active.resource_group_name
}
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 @@ -87,7 +87,8 @@ module "private_tcp_active_active" {
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 @@ -60,16 +60,16 @@ variable "proxy_public_ssh_key_secret_name" {
description = "The name of the public SSH key secret for the proxy."
}

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 "resource_group_name_dns" {
Expand Down
4 changes: 2 additions & 2 deletions tests/public-active-active/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

locals {
common_tags = {
Terraform = "cloud"
Environment = "${local.friendly_name_prefix}-test-public-active-active"
Description = "Public Active/Active"
Repository = "hashicorp/terraform-azurerm-terraform-enterprise"
Team = "Terraform Enterprise on Prem"
Team = "Terraform Enterprise"
OkToDelete = "True"
}

friendly_name_prefix = random_string.friendly_name.id
registry = "quay.io"
}
3 changes: 2 additions & 1 deletion tests/public-active-active/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ module "public_active_active" {
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 @@ -45,16 +45,16 @@ variable "key_vault_id" {
description = "The identity of the Key Vault which contains secrets and certificates."
}

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 "resource_group_name_dns" {
Expand Down
8 changes: 4 additions & 4 deletions tests/standalone-external/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

locals {
common_tags = {
Terraform = "False"
Environment = "${local.friendly_name_prefix}-test-standalone-external"
Description = "Standalone, External Services scenario deployed from CircleCI"
Description = "Standalone, External Services scenario"
Repository = "hashicorp/terraform-azurerm-terraform-enterprise"
Team = "Terraform Enterprise on Prem"
Team = "Terraform Enterprise"
OkToDelete = "True"
}

utility_module_test = var.license_file == null
friendly_name_prefix = random_string.friendly_name.id
registry = "quay.io"
utility_module_test = var.license_file == null
}
3 changes: 2 additions & 1 deletion tests/standalone-external/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ module "standalone_external" {
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}"
}
2 changes: 1 addition & 1 deletion tests/standalone-external/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ output "replicated_console_password" {
}

output "replicated_console_url" {
value = "${module.standalone_external.tfe_application_url}:8800"
value = module.standalone_external.tfe_console_url
description = "Terraform Enterprise Console URL"
}

Expand Down
8 changes: 4 additions & 4 deletions tests/standalone-external/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,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 "resource_group_name_dns" {
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 @@ -3,11 +3,10 @@

locals {
common_tags = {
Terraform = "False"
Environment = "${local.friendly_name_prefix}-test-standalone-mounted-disk"
Description = "Standalone, Mounted Disk scenario deployed from CircleCI"
Description = "Standalone, Mounted Disk scenario"
Repository = "hashicorp/terraform-azurerm-terraform-enterprise"
Team = "Terraform Enterprise on Prem"
Team = "Terraform Enterprise"
OkToDelete = "True"
}
vm_image_id = (
Expand Down Expand Up @@ -40,6 +39,8 @@ locals {
var.vm_image_sku != null &&
var.vm_image_version != null
) ? var.vm_image_version : null
utility_module_test = var.license_file == null

friendly_name_prefix = random_string.friendly_name.id
registry = "quay.io"
utility_module_test = var.license_file == null
}
3 changes: 2 additions & 1 deletion tests/standalone-mounted-disk/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ module "standalone_mounted_disk" {
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}"
}
2 changes: 1 addition & 1 deletion tests/standalone-mounted-disk/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ output "replicated_console_password" {
}

output "replicated_console_url" {
value = "${module.standalone_mounted_disk.tfe_application_url}:8800"
value = module.standalone_mounted_disk.tfe_console_url
description = "Terraform Enterprise Console URL"
}

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 @@ -53,16 +53,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 "resource_group_name_dns" {
Expand Down
18 changes: 12 additions & 6 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ variable "tfe_subdomain" {
}

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"
}

# DNS
Expand Down Expand Up @@ -841,16 +841,22 @@ variable "hairpin_addressing" {
description = "In some cloud environments, HTTP clients running on instances behind a loadbalancer cannot send requests to the public hostname of that load balancer. Use this setting to configure TFE services to redirect requests for the installation's FQDN to the instance's internal IP address. Defaults to false."
}

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" {
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 or if registry is 'images.releases.hashicorp.com') The password for the docker registry from which to source the terraform_enterprise container images."
}

variable "registry_username" {
default = "terraform"
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 "run_pipeline_image" {
Expand Down

0 comments on commit c2f8d87

Please sign in to comment.