terraform/juju/home-maas/05-memcache.tf

62 lines
1.3 KiB
Terraform
Raw Normal View History

2024-05-07 15:57:23 +00:00
resource "juju_machine" "memcache-1" {
2024-05-07 19:23:43 +00:00
model = var.model-name
placement = join(":",["lxd",juju_machine.all_machines["100"].machine_id])
2024-05-07 15:57:23 +00:00
constraints = "spaces=oam"
}
resource "juju_machine" "memcache-2" {
2024-05-07 19:23:43 +00:00
model = var.model-name
placement = join(":",["lxd",juju_machine.all_machines["101"].machine_id])
2024-05-07 15:57:23 +00:00
constraints = "spaces=oam"
}
resource "juju_machine" "memcache-3" {
2024-05-07 19:23:43 +00:00
model = var.model-name
placement = join(":",["lxd",juju_machine.all_machines["102"].machine_id])
2024-05-07 15:57:23 +00:00
constraints = "spaces=oam"
}
resource "juju_application" "memcached" {
name = "memcached"
model = var.model-name
2024-05-07 15:57:23 +00:00
charm {
2024-05-07 19:23:43 +00:00
name = "memcached"
channel = "latest/stable"
base = var.default-base
2024-05-07 15:57:23 +00:00
}
units = 3
placement = "${join(",",sort([
juju_machine.memcache-1.machine_id,
juju_machine.memcache-2.machine_id,
juju_machine.memcache-3.machine_id,
]))}"
endpoint_bindings = [{
2024-05-07 19:23:43 +00:00
space = var.internal-space
2024-05-07 15:57:23 +00:00
},{
endpoint = "cache"
2024-05-07 19:23:43 +00:00
space = var.internal-space
2024-05-07 15:57:23 +00:00
}]
config = {
allow-ufw-ip6-softfail = "true"
}
}
resource "juju_integration" "nova-cloud-controller-memcache" {
model = var.model-name
2024-05-07 15:57:23 +00:00
application {
2024-05-07 19:23:43 +00:00
name = juju_application.nova-cloud-controller.name
2024-05-07 15:57:23 +00:00
endpoint = "memcache"
}
application {
2024-05-07 19:23:43 +00:00
name = juju_application.memcached.name
2024-05-07 15:57:23 +00:00
endpoint = "cache"
}
}