-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
34 lines (31 loc) · 1.05 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
resource "null_resource" "cloudinit_userdata" {
connection {
type = var.conn_type
user = var.conn_user
private_key = base64decode(var.conn_ssh_key)
host = var.conn_target
}
provisioner "file" {
content = templatefile("${path.module}/templates/userdata.tpl", {
user_data_blob = var.user_data_blob
})
destination = "${var.snippet_root_dir}/${var.snippet_dir}/user-${var.snippet_file_base}"
}
}
resource "null_resource" "cloudinit_network" {
connection {
type = var.conn_type
user = var.conn_user
private_key = base64decode(var.conn_ssh_key)
host = var.conn_target
}
provisioner "file" {
content = templatefile("${path.module}/templates/network.tpl", {
primary_network = var.primary_network
extra_networks = var.extra_networks != null ? var.extra_networks : []
search_domains = var.search_domains
dns_servers = var.dns_servers
})
destination = "${var.snippet_root_dir}/${var.snippet_dir}/network-${var.snippet_file_base}"
}
}