Skip to content

Commit 6abbbe1

Browse files
committed
Cleans up module, adds new variable for region, updates script to clean-up better
1 parent 9d0298e commit 6abbbe1

File tree

6 files changed

+25
-19
lines changed

6 files changed

+25
-19
lines changed

01-provider.tf

Lines changed: 0 additions & 4 deletions
This file was deleted.

02-tunnel.tf

Lines changed: 0 additions & 15 deletions
This file was deleted.

03-tunnel-mgr.tf renamed to main.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
provider "linode" {
2+
token = var.linode_token
3+
}
4+
5+
resource "random_string" "tunnel_label" {
6+
length = 6
7+
special = false
8+
upper = false
9+
min_lower = 3
10+
min_numeric = 3
11+
}
12+
13+
resource "linode_instance" "tunnel" {
14+
region = var.region
15+
type = "g6-nanode-1"
16+
label = "tunnel-${random_string.tunnel_label.result}"
17+
image = "linode/ubuntu18.04"
18+
authorized_keys = ["${chomp(file(var.ssh_key))}"]
19+
}
20+
121
resource "null_resource" "tunnel_connection" {
222
depends_on = [linode_instance.tunnel]
323
provisioner "local-exec" {

99-output.tf renamed to outputs.tf

File renamed without changes.

scripts/proxy_status.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ connect_loop () {
44
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -q ${USER}@${HOST} "while true; do sleep 30; done" ; networksetup -setsocksfirewallproxy wi-fi 127.0.0.1 8888
55
}
66

7+
if [ ! -f nohup.out ]; then touch nohup.out; fi
78
networksetup -setsocksfirewallproxy wi-fi 127.0.0.1 8888
89
export -f connect_loop
910
nohup USER=${USER} HOST=${HOST} connect_loop &>/dev/null &

00-vars.tf renamed to variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ variable "set_osx_proxy" {
1717
default = false
1818
description = "Sets OS X SOCKS Proxy (all_proxy is set for other OS that use this variable to specify a proxy when you enable open_browser)"
1919
}
20+
variable "region" {
21+
default = "us-central"
22+
description = "Linode Region"
23+
}

0 commit comments

Comments
 (0)