diff --git a/juju/home-maas/00-variables.tf b/juju/home-maas/00-variables.tf index 4685ba4..8e719fe 100644 --- a/juju/home-maas/00-variables.tf +++ b/juju/home-maas/00-variables.tf @@ -15,11 +15,6 @@ variable "controller_ids" { "103", "104", "105"] } -variable "controller_ids_high" { - type = list(string) - default = ["103", "104", "105"] -} - variable "compute_ids" { type = list(string) default = ["1000", "1001", "1002", "1003", diff --git a/juju/home-maas/04-keystone.tf b/juju/home-maas/04-keystone.tf index fb5b1e4..b0e5013 100644 --- a/juju/home-maas/04-keystone.tf +++ b/juju/home-maas/04-keystone.tf @@ -1,7 +1,7 @@ resource "juju_machine" "keystone" { count = var.num_units model = var.model-name - placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids_high[count.index+var.num_units]].machine_id]) + placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids[count.index+var.num_units]].machine_id]) constraints = "spaces=oam" } diff --git a/juju/home-maas/04-rmq.tf b/juju/home-maas/04-rmq.tf index 106cc27..0000097 100644 --- a/juju/home-maas/04-rmq.tf +++ b/juju/home-maas/04-rmq.tf @@ -1,7 +1,7 @@ resource "juju_machine" "rmq" { count = var.num_units model = var.model-name - placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids_high[count.index+var.num_units]].machine_id]) + placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids[count.index+var.num_units]].machine_id]) constraints = "spaces=oam" } diff --git a/juju/home-maas/05-ceilometer.tf b/juju/home-maas/05-ceilometer.tf index 1897407..91a8347 100644 --- a/juju/home-maas/05-ceilometer.tf +++ b/juju/home-maas/05-ceilometer.tf @@ -1,7 +1,7 @@ resource "juju_machine" "ceilometer" { count = var.num_units model = var.model-name - placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids_high[count.index+var.num_units]].machine_id]) + placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids[count.index+var.num_units]].machine_id]) constraints = "spaces=oam" } diff --git a/juju/home-maas/05-ceph.tf b/juju/home-maas/05-ceph.tf index f87b058..4cdff7e 100644 --- a/juju/home-maas/05-ceph.tf +++ b/juju/home-maas/05-ceph.tf @@ -11,7 +11,7 @@ resource "juju_application" "ceph-osd" { units = length(var.compute_ids) placement = "${join(",", sort([ - for index, _ in var.compute_ids : + for index in var.compute_ids : juju_machine.all_machines[index].machine_id ]))}" diff --git a/juju/home-maas/05-gnocchi.tf b/juju/home-maas/05-gnocchi.tf index c384bf3..1132378 100644 --- a/juju/home-maas/05-gnocchi.tf +++ b/juju/home-maas/05-gnocchi.tf @@ -1,7 +1,7 @@ resource "juju_machine" "gnocchi" { count = var.num_units model = var.model-name - placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids_high[count.index+var.num_units]].machine_id]) + placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids[count.index+var.num_units]].machine_id]) constraints = "spaces=oam,ceph-access" } diff --git a/juju/home-maas/05-nova.tf b/juju/home-maas/05-nova.tf index 652e0e5..0ce4a9d 100644 --- a/juju/home-maas/05-nova.tf +++ b/juju/home-maas/05-nova.tf @@ -1,7 +1,7 @@ resource "juju_machine" "ncc" { count = var.num_units model = var.model-name - placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids_high[count.index+var.num_units]].machine_id]) + placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids[count.index+var.num_units]].machine_id]) constraints = "spaces=oam" } diff --git a/juju/home-maas/05-placement.tf b/juju/home-maas/05-placement.tf index b233dc1..6b674ea 100644 --- a/juju/home-maas/05-placement.tf +++ b/juju/home-maas/05-placement.tf @@ -1,7 +1,7 @@ resource "juju_machine" "placement" { count = var.num_units model = var.model-name - placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids_high[count.index+var.num_units]].machine_id]) + placement = join(":", ["lxd", juju_machine.all_machines[var.controller_ids[count.index+var.num_units]].machine_id]) constraints = "spaces=oam" } diff --git a/juju/home-maas/06-nova-compute.tf b/juju/home-maas/06-nova-compute.tf index a932d84..f37f1d5 100644 --- a/juju/home-maas/06-nova-compute.tf +++ b/juju/home-maas/06-nova-compute.tf @@ -11,7 +11,7 @@ resource "juju_application" "nova-compute-kvm" { units = length(var.compute_ids) placement = "${join(",", sort([ - for index, _ in var.compute_ids : + for index in var.compute_ids : juju_machine.all_machines[index].machine_id ]))}" diff --git a/juju/home-maas/07-controllers.tf b/juju/home-maas/07-controllers.tf index 20743b6..f4ecc62 100644 --- a/juju/home-maas/07-controllers.tf +++ b/juju/home-maas/07-controllers.tf @@ -13,7 +13,7 @@ resource "juju_application" "controller-server" { units = length(var.controller_ids) placement = "${join(",", sort([ - for index, _ in var.controller_ids : + for index in var.controller_ids : juju_machine.all_machines[index].machine_id ]))}" } diff --git a/juju/home-maas/08-neutron.tf b/juju/home-maas/08-neutron.tf index 94045d7..06ba712 100644 --- a/juju/home-maas/08-neutron.tf +++ b/juju/home-maas/08-neutron.tf @@ -11,7 +11,7 @@ resource "juju_application" "neutron-gateway" { units = var.num_units placement = "${join(",", sort([ - for index, _ in slice(var.controller_ids, 0, var.num_units+1) : + for index in slice(var.controller_ids, 0, var.num_units) : juju_machine.all_machines[index].machine_id ]))}" diff --git a/juju/home-maas/10-vault.tf b/juju/home-maas/10-vault.tf index 098b927..736b086 100644 --- a/juju/home-maas/10-vault.tf +++ b/juju/home-maas/10-vault.tf @@ -1,7 +1,7 @@ resource "juju_machine" "vault" { count = var.num_units model = var.model-name - placement = join(":",["lxd",juju_machine.all_machines[var.sdn_ids[count.index+var.num_units]].machine_id]) + placement = join(":",["lxd",juju_machine.all_machines[var.sdn_ids[count.index]].machine_id]) constraints = "spaces=oam" } @@ -76,7 +76,7 @@ resource "juju_application" "hacluster-vault" { resource "juju_machine" "etcd" { count = var.num_units model = var.model-name - placement = join(":",["lxd",juju_machine.all_machines[var.sdn_ids[count.index+var.num_units]].machine_id]) + placement = join(":",["lxd",juju_machine.all_machines[var.sdn_ids[count.index]].machine_id]) constraints = "spaces=oam" }