-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
41 lines (36 loc) · 1 KB
/
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
resource "linode_instance" "main" {
label = var.name
image = var.image
region = var.region
type = var.type
authorized_keys = var.authorized_keys
root_pass = var.root_pass
group = var.group
tags = var.tags
connection {
type = "ssh"
user = "root"
agent = "false"
password = var.root_pass
private_key = var.private_key
host = self.ip_address
}
provisioner "file" {
source = "${path.module}/config"
destination = "/tmp"
}
provisioner "file" {
source = "${path.module}/scripts"
destination = "/tmp"
}
provisioner "remote-exec" {
inline = [
"chmod 755 /tmp/scripts/*",
"mv /tmp/scripts/* /usr/local/bin/",
"/usr/local/bin/install_docker.sh",
"/usr/local/bin/install_fail2ban.sh",
"mv /tmp/config/* /data/",
"ACME_EMAIL=\"${var.traefik_acme_email}\" FQDN=\"${var.fqdn}\" /usr/local/bin/deploy.sh"
]
}
}