-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmain.tf
45 lines (39 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
42
43
44
45
#===============================================
# Create zabbix server
#===============================================
resource "google_compute_instance" "zabbix" {
name = "app-zabbix"
machine_type = "g1-small"
zone = "${var.zone_instance}"
tags = ["${var.zabbix_tag}"]
boot_disk {
initialize_params {
image = var.disk_image
}
}
network_interface {
network = "default"
access_config {
}
}
metadata = {
sshKeys = "${var.default_user}:${file("~/.ssh/id_rsa.pub")}"
}
connection {
host = self.network_interface.0.access_config.0.nat_ip
type = "ssh"
user = "${var.default_user}"
private_key = "${file("~/.ssh/id_rsa")}"
}
provisioner "file" {
source = "scripts/setupzabbix.sh"
destination = "~/setupzabbix.sh"
}
provisioner "file" {
source = "scripts/zabconf"
destination = "~/"
}
# provisioner "remote-exec" {
# inline = ["${file("scripts/setupzabbix.sh")}"]
# }
}