Working with centralized config
This commit is contained in:
19
main.tf
19
main.tf
@@ -78,7 +78,8 @@ resource "digitalocean_droplet" "machine" {
|
||||
region = var.datacenter
|
||||
size = var.server_type
|
||||
ssh_keys = [digitalocean_ssh_key.first.fingerprint]
|
||||
user_data = data.ct_config.machine-ignitions[each.key].rendered
|
||||
# user_data = data.ct_config.machine-ignitions[each.key].rendered
|
||||
user_data = file("flatcar/ignition.json")
|
||||
lifecycle {
|
||||
create_before_destroy = true
|
||||
}
|
||||
@@ -90,14 +91,14 @@ resource "digitalocean_reserved_ip_assignment" "machine" {
|
||||
droplet_id = digitalocean_droplet.machine[each.key].id
|
||||
}
|
||||
|
||||
data "ct_config" "machine-ignitions" {
|
||||
for_each = toset(var.machines)
|
||||
content = templatefile("${path.module}/cl/machine-${each.key}.yaml.tmpl", {
|
||||
ssh_keys = jsonencode(var.ssh_keys),
|
||||
name = each.key
|
||||
})
|
||||
strict = true
|
||||
}
|
||||
# data "ct_config" "machine-ignitions" {
|
||||
# for_each = toset(var.machines)
|
||||
# content = templatefile("${path.module}/cl/machine-${each.key}.yaml.tmpl", {
|
||||
# ssh_keys = jsonencode(var.ssh_keys),
|
||||
# name = each.key
|
||||
# })
|
||||
# strict = true
|
||||
# }
|
||||
|
||||
output "ip-addresses" {
|
||||
value = {
|
||||
|
||||
Reference in New Issue
Block a user