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