From 874388de7aac38b146d1bb667614cff7c072d449 Mon Sep 17 00:00:00 2001 From: Niklas Schmidtmer Date: Thu, 2 Jan 2025 13:06:16 +0100 Subject: [PATCH] Allow passing additional node/cluster settings to crate.yml --- aws/ec2.tf | 1 + aws/scripts/cloud-init-cratedb-rpm.tftpl | 2 ++ aws/scripts/cloud-init-cratedb-tar.tftpl | 2 ++ aws/variables.tf | 6 ++++++ 4 files changed, 11 insertions(+) diff --git a/aws/ec2.tf b/aws/ec2.tf index 69f6fde..c466265 100644 --- a/aws/ec2.tf +++ b/aws/ec2.tf @@ -52,6 +52,7 @@ data "cloudinit_config" "config" { crate_protocol = var.crate.ssl_enable ? "https" : "http" crate_ssl_certificate = base64encode(tls_self_signed_cert.ssl.cert_pem) crate_ssl_private_key = base64encode(tls_private_key.ssl.private_key_pem) + cratedb_user_settings = indent(8, yamlencode(var.cratedb_settings)) } ) } diff --git a/aws/scripts/cloud-init-cratedb-rpm.tftpl b/aws/scripts/cloud-init-cratedb-rpm.tftpl index 5ddcd08..df2db7e 100644 --- a/aws/scripts/cloud-init-cratedb-rpm.tftpl +++ b/aws/scripts/cloud-init-cratedb-rpm.tftpl @@ -80,6 +80,8 @@ write_files: ssl.keystore_filepath: /etc/crate/keystore.p12 ssl.keystore_password: changeit ssl.keystore_key_password: changeit + + ${cratedb_user_settings} owner: root:root path: /etc/crate/crate.yml permissions: "0755" diff --git a/aws/scripts/cloud-init-cratedb-tar.tftpl b/aws/scripts/cloud-init-cratedb-tar.tftpl index 861de1a..7b662f2 100644 --- a/aws/scripts/cloud-init-cratedb-tar.tftpl +++ b/aws/scripts/cloud-init-cratedb-tar.tftpl @@ -71,6 +71,8 @@ write_files: ssl.keystore_filepath: /opt/crate/config/keystore.p12 ssl.keystore_password: changeit ssl.keystore_key_password: changeit + + ${cratedb_user_settings} owner: root:root path: /opt/crate/config/crate.yml permissions: "0755" diff --git a/aws/variables.tf b/aws/variables.tf index 1432403..d5886b4 100644 --- a/aws/variables.tf +++ b/aws/variables.tf @@ -34,6 +34,12 @@ variable "crate" { description = "CrateDB application configuration" } +variable "cratedb_settings" { + type = map(string) + default = {} + description = "CrateDB settings applied to crate.yml" +} + variable "cratedb_password" { type = string default = null