-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcloud-init.tf
42 lines (34 loc) · 914 Bytes
/
cloud-init.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
37
38
39
40
41
42
data "template_file" "config" {
template = "${file("${path.module}/init.tpl")}"
vars {
hostname = "${var.hostname}"
}
}
data "template_file" "alias_nvme" {
template = "${file("${path.module}/scripts/ebs_alias.sh.tpl")}"
}
data "template_file" "attach_nvme" {
template = "${file("${path.module}/scripts/ebs_mount.sh.tpl")}"
vars {
volume_name = "/dev/xvdf"
mount_point = "/data"
file_system = "ext4"
}
}
data "template_cloudinit_config" "config" {
gzip = false
base64_encode = false
part {
filename = "terraform.tpl"
content_type = "text/cloud-config"
content = "${data.template_file.config.rendered}"
}
part {
content_type = "text/x-shellscript"
content = "${data.template_file.alias_nvme.rendered}"
}
part {
content_type = "text/x-shellscript"
content = "${data.template_file.attach_nvme.rendered}"
}
}