forked from getamis/terraform-ignition-etcd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
volume.tf
36 lines (29 loc) · 876 Bytes
/
volume.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
locals {
systemd_etcd_data_mount_name = replace(trimprefix(var.data_path, "/"), "/", "-")
device_partition_name = "${var.device_name}p1"
}
data "ignition_disk" "ectd_data" {
device = var.device_name
wipe_table = false
partition {
label = "ETCD-DATA"
number = 1
sizemib = 0
startmib = 0
}
}
resource "random_uuid" "etcd_data_fs_uuid" {}
data "ignition_filesystem" "ectd_data" {
format = "ext4"
device = local.device_partition_name
wipe_filesystem = false
label = "etcd-data"
uuid = random_uuid.etcd_data_fs_uuid.result
}
data "ignition_systemd_unit" "etcd_data_mount" {
name = "${local.systemd_etcd_data_mount_name}.mount"
content = templatefile("${path.module}/templates/data.mount.tpl", {
device_name = local.device_partition_name
data_path = var.data_path
})
}