-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
65 lines (60 loc) · 2.27 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
data "cloudinit_config" "main" {
gzip = var.gzip
base64_encode = var.base64_encode
part {
filename = "ip_forwarding.sh"
content_type = "text/x-shellscript"
content = file("${path.module}/files/ip_forwarding.sh")
}
part {
filename = "udp_offloads.sh"
content_type = "text/x-shellscript"
content = file("${path.module}/files/udp_offloads.sh")
}
part {
filename = "install_tailscale.sh"
content_type = "text/x-shellscript"
content = templatefile("${path.module}/templates/install_tailscale.sh.tmpl", {
TRACK = var.track
MAX_RETRIES = var.max_retries
RETRY_DELAY = var.retry_delay
})
}
part {
filename = "setup_tailscale.sh"
content_type = "text/x-shellscript"
content = templatefile("${path.module}/templates/setup_tailscale.sh.tmpl", {
ADVERTISE_ROUTES = join(",", var.advertise_routes)
ADVERTISE_TAGS = join(",", var.advertise_tags)
ACCEPT_DNS = var.accept_dns
ACCEPT_ROUTES = var.accept_routes
ADVERTISE_CONNECTOR = var.advertise_connector
ADVERTISE_EXIT_NODE = var.advertise_exit_node
HOSTNAME = var.hostname
TAILSCALE_SSH = var.enable_ssh
AUTH_KEY = sensitive(var.auth_key)
EXIT_NODE = var.exit_node
EXIT_NODE_ALLOW_LAN_ACCESS = var.exit_node_allow_lan_access
FORCE_REAUTH = var.force_reauth
JSON = var.json
LOGIN_SERVER = var.login_server
OPERATOR = var.operator
RESET = var.reset
SHIELDS_UP = var.shields_up
TIMEOUT = var.timeout
SNAT_SUBNET_ROUTES = var.snat_subnet_routes
NETFILTER_MODE = var.netfilter_mode
STATEFUL_FILTERING = var.stateful_filtering
MAX_RETRIES = var.max_retries
RETRY_DELAY = var.retry_delay
})
}
dynamic "part" {
for_each = var.additional_parts
content {
filename = part.value.filename
content_type = part.value.content_type
content = part.value.content
}
}
}