diff --git a/terraform/airgapped terraform enterprise on azure/README.md b/terraform/airgapped terraform enterprise on azure/README.md index 66674e7..0b1e3cd 100644 --- a/terraform/airgapped terraform enterprise on azure/README.md +++ b/terraform/airgapped terraform enterprise on azure/README.md @@ -4,6 +4,9 @@ Stateless active/active. +1. [Requirements](#requirements) +2. [Sources](#sources) + ## Requirements | Requirement | Description | @@ -17,15 +20,19 @@ Stateless active/active. ## Sources - [Terraform Enterprise] +- [Automated installations] of Replicated - Hashicorp's [Terraform Enterprise Azure Module][hashicorp/terraform-azurerm-terraform-enterprise] on GitHub - Azure's [Terraform Enterprise Azure Instance Module][azure-terraform/terraform-azurerm-terraform-enterprise-instance] on GitHub [requirements diagram]: design/requirements.png - + [terraform enterprise]: https://developer.hashicorp.com/terraform/enterprise + +[automated installations]: https://help.replicated.com/docs/native/customer-installations/automating/ + [azure-terraform/terraform-azurerm-terraform-enterprise-instance]: https://github.com/Azure-Terraform/terraform-azurerm-terraform-enterprise-instance [hashicorp/terraform-azurerm-terraform-enterprise]: https://github.com/hashicorp/terraform-azurerm-terraform-enterprise diff --git a/terraform/airgapped terraform enterprise on azure/locals.tf b/terraform/airgapped terraform enterprise on azure/locals.tf new file mode 100644 index 0000000..a80463d --- /dev/null +++ b/terraform/airgapped terraform enterprise on azure/locals.tf @@ -0,0 +1,20 @@ +locals { + # See https://help.replicated.com/docs/native/customer-installations/automating/#configure-replicated-automatically + replicated_config = {} + + # Replicated's settings file is JSON formatted. + # See https://help.replicated.com/docs/native/customer-installations/automating + replicated_config_file_contents = jsonencode(local.replicated_config) + + # See https://developer.hashicorp.com/terraform/enterprise/install/automated/automating-the-installer#available-settings + tfe_config = { + hostname = "hostname" + enc_password = "password" + } + + # TFE's settings file is JSON formatted. + # All defined keys must be objects with the 'value' key in it. (ノಠ益ಠ)ノ彡┻━┻ + # All values must be strings. + # See https://developer.hashicorp.com/terraform/enterprise/install/automated/automating-the-installer#format + tfe_config_file_contents = jsonencode({ for k, v in local.tfe_config : k => { "value" : tostring(v) } }) +} diff --git a/terraform/airgapped terraform enterprise on azure/outputs.tf b/terraform/airgapped terraform enterprise on azure/outputs.tf new file mode 100644 index 0000000..6fb0b14 --- /dev/null +++ b/terraform/airgapped terraform enterprise on azure/outputs.tf @@ -0,0 +1,12 @@ +output "replicated_config_file" { + value = { + contents = local.replicated_config_file_contents + path = var.replicated_config_file_path + } +} +output "tfe_config_file" { + value = { + contents = local.tfe_config_file_contents + path = var.tfe_config_file_path + } +} diff --git a/terraform/airgapped terraform enterprise on azure/variables.tf b/terraform/airgapped terraform enterprise on azure/variables.tf new file mode 100644 index 0000000..370682b --- /dev/null +++ b/terraform/airgapped terraform enterprise on azure/variables.tf @@ -0,0 +1,7 @@ +variable "replicated_config_file_path" { + default = "/etc/replicated.conf" + description = "Only read on initial startup." +} +variable "tfe_config_file_path" { + default = "/etc/ptfe.settings.json" +}