Added configuration files creation for TFE and replicated

This commit is contained in:
Michele Cereda
2023-01-17 21:54:57 +01:00
parent 9098b62c69
commit cb76f00e9d
4 changed files with 47 additions and 1 deletions

View File

@@ -4,6 +4,9 @@
Stateless active/active. Stateless active/active.
1. [Requirements](#requirements)
2. [Sources](#sources)
## Requirements ## Requirements
| Requirement | Description | | Requirement | Description |
@@ -17,15 +20,19 @@ Stateless active/active.
## Sources ## Sources
- [Terraform Enterprise] - [Terraform Enterprise]
- [Automated installations] of Replicated
- Hashicorp's [Terraform Enterprise Azure Module][hashicorp/terraform-azurerm-terraform-enterprise] on GitHub - 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 - Azure's [Terraform Enterprise Azure Instance Module][azure-terraform/terraform-azurerm-terraform-enterprise-instance] on GitHub
<!-- knowledge base --> <!-- knowledge base -->
[requirements diagram]: design/requirements.png [requirements diagram]: design/requirements.png
<!-- hashicorp documentation --> <!-- hashicorp references -->
[terraform enterprise]: https://developer.hashicorp.com/terraform/enterprise [terraform enterprise]: https://developer.hashicorp.com/terraform/enterprise
<!-- replicated references -->
[automated installations]: https://help.replicated.com/docs/native/customer-installations/automating/
<!-- repositories --> <!-- repositories -->
[azure-terraform/terraform-azurerm-terraform-enterprise-instance]: https://github.com/Azure-Terraform/terraform-azurerm-terraform-enterprise-instance [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 [hashicorp/terraform-azurerm-terraform-enterprise]: https://github.com/hashicorp/terraform-azurerm-terraform-enterprise

View File

@@ -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) } })
}

View File

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

View File

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