-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprovision.tf
43 lines (37 loc) · 1.07 KB
/
provision.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
# generate graph of dependencies: terraform graph ../infra-terraform/ | dot -Tpng > graph.png
resource "null_resource" "generic" {
triggers {
vm = "${azurerm_virtual_machine.wellformed.name}"
}
depends_on = ["azurerm_virtual_machine.wellformed"]
}
resource "null_resource" "wellformed" {
triggers {
vm = "${azurerm_virtual_machine.wellformed.name}"
}
depends_on = ["azurerm_virtual_machine.wellformed"]
connection {
type = "ssh"
host = "${azurerm_public_ip.publicip.ip_address}"
user = "testadmin"
private_key = "${file("keys/id_rsa")}"
}
# copy ssh keys
provisioner "file" {
source = "keys/"
destination = "/home/testadmin/.ssh/"
}
# copy all provisioner scripts to /tmp
provisioner "file" {
source = "scripts/"
destination = "/tmp/"
}
# execute!
# provisioner "remote-exec" {
# inline = [
# "sudo chmod +x /tmp/*.sh",
# "sudo /tmp/generic.sh",
# "sudo /tmp/wellformedinstall.sh"
# ]
# }
}