-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
47 lines (38 loc) · 921 Bytes
/
main.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
43
44
45
46
47
data "template_file" "setup" {
template = "${file("${path.module}/assets/setup.sh")}"
vars {
algo_repo = "${var.algo_repo}"
}
}
resource "linode_instance" "algo" {
label = "${var.name}-algo"
region = "${var.region}"
type = "${var.type}"
disk {
label = "root"
size = 10240
authorized_keys = ["${var.ssh_keys}"]
authorized_users = ["${var.ssh_users}"]
image = "${var.source_image_id}"
}
config {
label = "default"
kernel = "linode/grub2"
devices {
sda = {
disk_label = "root"
}
}
}
provisioner "file" {
source = "${path.module}/assets/sshd_config"
destination = "/etc/ssh/sshd_config"
}
provisioner "file" {
content = "${data.template_file.setup.rendered}"
destination = "/root/setup.sh"
}
provisioner "remote-exec" {
inline = ["bash /root/setup.sh"]
}
}