Skip to content

Commit

Permalink
add haproxy vars
Browse files Browse the repository at this point in the history
  • Loading branch information
dfry committed Jun 6, 2023
1 parent 9bc3f8e commit ce20111
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 18 deletions.
4 changes: 4 additions & 0 deletions terraform/aws/base-k8s/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ output "bastion_hosts_var_maps" {
sensitive = false
value = {
ansible_ssh_common_args = "-o StrictHostKeyChecking=no"
nexus_fqdn = module.post_config.nexus_fqdn
nexus_docker_repo_listening_port = module.post_config.nexus_docker_repo_listening_port
seaweedfs_fqdn = module.post_config.seaweedfs_fqdn
seaweedfs_s3_listening_port = module.post_config.seaweedfs_s3_listening_port
}
}

Expand Down
8 changes: 8 additions & 0 deletions terraform/aws/control-center-infra/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ output "nexus_fqdn" {
value = aws_route53_record.nexus_server_private.fqdn
}

output "seaweedfs_s3_listening_port" {
value = var.seaweedfs_s3_listening_port
}

output "seaweedfs_fqdn" {
value = aws_route53_record.seaweedfs_server_private.fqdn
}

output "gitlab_hosts_var_maps" {
sensitive = true
value = {
Expand Down
24 changes: 24 additions & 0 deletions terraform/aws/post-config-k8s/gitlab-variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,28 @@ data "gitlab_project_variable" "cloud_region" {
data "gitlab_project_variable" "netmaker_ops_token" {
project = var.current_gitlab_project_id
key = "NETMAKER_OPS_TOKEN"
}

data "gitlab_project" "env" {
id = var.current_gitlab_project_id
}

data "gitlab_group_variable" "nexus_fqdn" {
group = data.gitlab_project.env.namespace_id
key = "NEXUS_FQDN"
}

data "gitlab_group_variable" "nexus_docker_repo_listening_port" {
group = data.gitlab_project.env.namespace_id
key = "NEXUS_DOCKER_REPO_LISTENING_PORT"
}

data "gitlab_group_variable" "seaweedfs_fqdn" {
group = data.gitlab_project.env.namespace_id
key = "SEAWEEDFS_FQDN"
}

data "gitlab_group_variable" "seaweedfs_s3_listening_port" {
group = data.gitlab_project.env.namespace_id
key = "SEAWEEDFS_S3_LISTENING_PORT"
}
16 changes: 16 additions & 0 deletions terraform/aws/post-config-k8s/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,20 @@ output "vault_kms_seal_kms_key_id" {
output "netmaker_ops_token" {
value = data.gitlab_project_variable.netmaker_ops_token.value
sensitive = true
}

output "nexus_fqdn" {
value = data.gitlab_group_variable.nexus_fqdn.value
}

output "nexus_docker_repo_listening_port" {
value = data.gitlab_group_variable.nexus_docker_repo_listening_port.value
}

output "seaweedfs_fqdn" {
value = data.gitlab_group_variable.seaweedfs_fqdn.value
}

output "seaweedfs_s3_listening_port" {
value = data.gitlab_group_variable.seaweedfs_s3_listening_port.value
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,35 @@ dependency "ansible-cc-deploy" {
dependency "control_center_deploy" {
config_path = "../control-center-deploy"
mock_outputs = {
iac_user_key_secret = "temporary-dummy-id"
iac_user_key_id = "temporary-dummy-id"
gitlab_root_token = "temporary-dummy-id"
gitlab_server_hostname = "temporary-dummy-id"
netmaker_oidc_callback_url = "temporary-dummy-id"
iac_user_key_secret = "temporary-dummy-id"
iac_user_key_id = "temporary-dummy-id"
gitlab_root_token = "temporary-dummy-id"
gitlab_server_hostname = "temporary-dummy-id"
netmaker_oidc_callback_url = "temporary-dummy-id"
seaweedfs_s3_listening_port = "temporary-dummy-id"
nexus_docker_repo_listening_port = "temporary-dummy-id"
seaweedfs_fqdn = "temporary-dummy-id"
nexus_fqdn = "temporary-dummy-id"
}
mock_outputs_allowed_terraform_commands = ["init", "validate", "plan", "show"]
}

inputs = {
iac_user_key_secret = dependency.control_center_deploy.outputs.iac_user_key_secret
iac_user_key_id = dependency.control_center_deploy.outputs.iac_user_key_id
gitlab_admin_rbac_group = local.env_vars.gitlab_admin_rbac_group
gitlab_readonly_rbac_group = local.env_vars.gitlab_readonly_rbac_group
enable_netmaker_oidc = local.env_vars.enable_netmaker_oidc
netmaker_oidc_redirect_url = dependency.control_center_deploy.outputs.netmaker_oidc_callback_url
private_repo_user = get_env("PRIVATE_REPO_USER")
private_repo_token = get_env("PRIVATE_REPO_TOKEN")
iac_templates_tag = get_env("IAC_TEMPLATES_TAG")
iac_terraform_modules_tag = get_env("IAC_TERRAFORM_MODULES_TAG")
control_center_cloud_provider = get_env("CONTROL_CENTER_CLOUD_PROVIDER")
iac_user_key_secret = dependency.control_center_deploy.outputs.iac_user_key_secret
iac_user_key_id = dependency.control_center_deploy.outputs.iac_user_key_id
gitlab_admin_rbac_group = local.env_vars.gitlab_admin_rbac_group
gitlab_readonly_rbac_group = local.env_vars.gitlab_readonly_rbac_group
enable_netmaker_oidc = local.env_vars.enable_netmaker_oidc
netmaker_oidc_redirect_url = dependency.control_center_deploy.outputs.netmaker_oidc_callback_url
seaweedfs_s3_listening_port = dependency.control_center_deploy.outputs.seaweedfs_s3_listening_port
nexus_docker_repo_listening_port = dependency.control_center_deploy.outputs.nexus_docker_repo_listening_port
seaweedfs_fqdn = dependency.control_center_deploy.outputs.seaweedfs_fqdn
nexus_fqdn = dependency.control_center_deploy.outputs.nexus_fqdn
private_repo_user = get_env("PRIVATE_REPO_USER")
private_repo_token = get_env("PRIVATE_REPO_TOKEN")
iac_templates_tag = get_env("IAC_TEMPLATES_TAG")
iac_terraform_modules_tag = get_env("IAC_TERRAFORM_MODULES_TAG")
control_center_cloud_provider = get_env("CONTROL_CENTER_CLOUD_PROVIDER")
}

locals {
Expand Down Expand Up @@ -64,4 +72,4 @@ provider "gitlab" {
base_url = "https://${dependency.control_center_deploy.outputs.gitlab_server_hostname}"
}
EOF
}
}
36 changes: 36 additions & 0 deletions terraform/gitlab/control-center-gitlab-config/gitlab.tf
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,42 @@ resource "gitlab_group_variable" "gitlab_ci_pat" {
environment_scope = "*"
}

resource "gitlab_group_variable" "nexus_fqdn" {
group = gitlab_group.iac.id
key = "NEXUS_FQDN"
value = var.nexus_fqdn
protected = true
masked = false
environment_scope = "*"
}

resource "gitlab_group_variable" "nexus_docker_repo_listening_port" {
group = gitlab_group.iac.id
key = "NEXUS_DOCKER_REPO_LISTENING_PORT"
value = var.nexus_docker_repo_listening_port
protected = true
masked = false
environment_scope = "*"
}

resource "gitlab_group_variable" "seaweedfs_fqdn" {
group = gitlab_group.iac.id
key = "SEAWEEDFS_FQDN"
value = var.seaweedfs_fqdn
protected = true
masked = false
environment_scope = "*"
}

resource "gitlab_group_variable" "seaweedfs_s3_listening_port" {
group = gitlab_group.iac.id
key = "SEAWEEDFS_S3_LISTENING_PORT"
value = var.seaweedfs_s3_listening_port
protected = true
masked = false
environment_scope = "*"
}

locals {
private_repo_docker_credentials = base64encode("${var.private_repo_user}:${var.private_repo_token}")
docker_auth_config = jsonencode({
Expand Down
16 changes: 15 additions & 1 deletion terraform/gitlab/control-center-gitlab-config/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,18 @@ variable "iac_templates_tag" {
}
variable "control_center_cloud_provider" {
description = "control_center_cloud_provider"
}
}

variable "seaweedfs_fqdn" {
description = "seaweedfs_fqdn"
}
variable "seaweedfs_s3_listening_port" {
description = "seaweedfs_s3_listening_port"
}

variable "nexus_fqdn" {
description = "nexus_fqdn"
}
variable "nexus_docker_repo_listening_port" {
description = "nexus_docker_repo_listening_port"
}

0 comments on commit ce20111

Please sign in to comment.