From cfc409a998b00c8264ea82f73780f6fa114cbe86 Mon Sep 17 00:00:00 2001 From: Matthew Baggett <matthew@baggett.me> Date: Mon, 3 Mar 2025 19:04:37 +0100 Subject: [PATCH] Tidyup memcached impl. --- products/memcached/inputs.tf | 5 +++++ products/memcached/memcached.tf | 10 +--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/products/memcached/inputs.tf b/products/memcached/inputs.tf index ba1cd97..eec453f 100644 --- a/products/memcached/inputs.tf +++ b/products/memcached/inputs.tf @@ -1,3 +1,8 @@ +variable "enable" { + type = bool + description = "Whether to enable the service." + default = true +} variable "memcached_image" { default = "memcached" type = string diff --git a/products/memcached/memcached.tf b/products/memcached/memcached.tf index 38b5b1a..be136e3 100644 --- a/products/memcached/memcached.tf +++ b/products/memcached/memcached.tf @@ -1,5 +1,6 @@ module "service" { source = "../../docker/service" + enable = var.enable image = "${var.memcached_image}:${var.memcached_version}" stack_name = var.stack_name service_name = var.service_name @@ -11,15 +12,6 @@ module "service" { #healthcheck_timeout = "5s" #healthcheck_retries = 3 converge_enable = false # @todo MB: fix healthcheck and fix this. - volumes = local.volumes - mounts = local.mounts ports = var.ports placement_constraints = var.placement_constraints } - -locals { - volumes = var.data_persist_path == null ? { - "data" = "/var/lib/mysql" - } : {} - mounts = var.data_persist_path != null ? zipmap([var.data_persist_path], ["/var/lib/mysql"]) : {} -} \ No newline at end of file