Working block storage.
This commit is contained in:
16
main.tf
16
main.tf
@@ -71,6 +71,16 @@ resource "digitalocean_reserved_ip" "machine" {
|
||||
region = digitalocean_droplet.machine[each.key].region
|
||||
}
|
||||
|
||||
resource "digitalocean_volume" "machine" {
|
||||
for_each = toset(var.machines)
|
||||
region = var.datacenter
|
||||
name = "${var.cluster_name}-${each.key}"
|
||||
size = 30
|
||||
initial_filesystem_type = "ext4"
|
||||
initial_filesystem_label = "appstorage"
|
||||
description = "persistent storage for docker apps"
|
||||
}
|
||||
|
||||
resource "digitalocean_droplet" "machine" {
|
||||
for_each = toset(var.machines)
|
||||
name = "${var.cluster_name}-${each.key}"
|
||||
@@ -91,6 +101,12 @@ resource "digitalocean_reserved_ip_assignment" "machine" {
|
||||
droplet_id = digitalocean_droplet.machine[each.key].id
|
||||
}
|
||||
|
||||
resource "digitalocean_volume_attachment" "machine" {
|
||||
for_each = toset(var.machines)
|
||||
droplet_id = digitalocean_droplet.machine[each.key].id
|
||||
volume_id = digitalocean_volume.machine[each.key].id
|
||||
}
|
||||
|
||||
# data "ct_config" "machine-ignitions" {
|
||||
# for_each = toset(var.machines)
|
||||
# content = templatefile("${path.module}/cl/machine-${each.key}.yaml.tmpl", {
|
||||
|
||||
Reference in New Issue
Block a user