Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

refactor: Use dynamic addresses via templates #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions uploads/us/_defaults/client/consul/config/defaults.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ enable_local_script_checks = true

server = false

client_addr = "{{ GetInterfaceIP \"eth1\" }}"
advertise_addr = "{{ GetInterfaceIP \"eth1\" }}"
advertise_addr_wan = "{{ GetInterfaceIP \"eth1\" }}"

ports {
http = 8500
grpc = 8502
Expand Down
17 changes: 11 additions & 6 deletions uploads/us/_defaults/client/nomad/config/defaults.hcl
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
data_dir = "/opt/nomad"

region = "us"

bind_addr = "{{ GetInterfaceIP \"eth1\" }}"

server {
enabled = false
}

ports {
http = 4646
rpc = 4647
serf = 4648
}

client {
enabled = true

Expand All @@ -30,12 +40,6 @@ client {
}
}

ports {
http = 4646
rpc = 4647
serf = 4648
}

telemetry {
collection_interval = "1s"
disable_hostname = true
Expand Down Expand Up @@ -68,6 +72,7 @@ plugin "docker" {
}

consul {
address = "{{ GetInterfaceIP \"eth1\" }}:8500"
server_service_name = "nomad"
client_service_name = "nomad-client"
auto_advertise = true
Expand Down
4 changes: 4 additions & 0 deletions uploads/us/_defaults/server/consul/config/defaults.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ enable_local_script_checks = true

server = true

client_addr = "{{ GetInterfaceIP \"eth1\" }}"
advertise_addr = "{{ GetInterfaceIP \"eth1\" }}"
advertise_addr_wan = "{{ GetInterfaceIP \"eth1\" }}"

ports {
http = 8500
grpc = 8502
Expand Down
13 changes: 9 additions & 4 deletions uploads/us/_defaults/server/nomad/config/defaults.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
data_dir = "/opt/nomad"

region = "us"

bind_addr = "{{ GetInterfaceIP \"eth1\" }}"

server {
enabled = true
bootstrap_expect = 3
Expand All @@ -13,16 +17,16 @@ server {
}
}

client {
enabled = false
}

ports {
http = 4646
rpc = 4647
serf = 4648
}

client {
enabled = false
}

telemetry {
collection_interval = "1s"
disable_hostname = true
Expand All @@ -32,6 +36,7 @@ telemetry {
}

consul {
address = "{{ GetInterfaceIP \"eth1\" }}:8500"
server_service_name = "nomad"
client_service_name = "nomad-client"
auto_advertise = true
Expand Down
13 changes: 13 additions & 0 deletions uploads/us/_defaults/server/vault/config/defaults.hcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
api_addr = "http://{{ GetInterfaceIP \"eth1\" }}:8200"
cluster_addr = "http://{{ GetInterfaceIP \"eth1\" }}:8201"

ui = true

disable_mlock = true

listener "tcp" {
tls_disable = true
address = "{{ GetInterfaceIP \"eth1\" }}:8200"
cluster_address = "{{ GetInterfaceIP \"eth1\" }}:8201"

telemetry {
unauthenticated_metrics_access = true
}
}

telemetry {
prometheus_retention_time = "24h"
disable_hostname = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
bind_addr = "192.168.60.30"
client_addr = "192.168.60.30"
7 changes: 0 additions & 7 deletions uploads/us/us-east-1/192.168.60.30/nomad/config/overrides.hcl
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
region = "us"
datacenter = "us-east-1"

bind_addr = "192.168.60.30"

consul {
address = "192.168.60.30:8500"
}

vault {
enabled = true
address = "http://192.168.60.30:8200"
Expand Down
13 changes: 0 additions & 13 deletions uploads/us/us-east-1/192.168.60.30/vault/config/overrides.hcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
api_addr = "http://192.168.60.30:8200"
cluster_addr = "http://192.168.60.30:8201"

storage "raft" {
path = "/opt/vault"
node_id = "us-east-1"
Expand All @@ -9,13 +6,3 @@ storage "raft" {
service_registration "consul" {
address = "192.168.61.30:8500"
}

listener "tcp" {
tls_disable = true
address = "192.168.60.30:8200"
cluster_address = "192.168.60.30:8201"

telemetry {
unauthenticated_metrics_access = true
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
bind_addr = "192.168.61.30"
client_addr = "192.168.61.30"
7 changes: 0 additions & 7 deletions uploads/us/us-east-1/192.168.61.30/nomad/config/overrides.hcl
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
region = "us"
datacenter = "us-east-1"

bind_addr = "192.168.61.30"

consul {
address = "192.168.61.30:8500"
}

vault {
enabled = true
address = "http://192.168.60.30:8200"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
bind_addr = "192.168.60.10"
client_addr = "192.168.60.10"
7 changes: 0 additions & 7 deletions uploads/us/us-west-1/192.168.60.10/nomad/config/overrides.hcl
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
region = "us"
datacenter = "us-west-1"

bind_addr = "192.168.60.10"

consul {
address = "192.168.60.10:8500"
}

vault {
enabled = true
address = "http://192.168.60.10:8200"
Expand Down
13 changes: 0 additions & 13 deletions uploads/us/us-west-1/192.168.60.10/vault/config/overrides.hcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
api_addr = "http://192.168.60.10:8200"
cluster_addr = "http://192.168.60.10:8201"

storage "raft" {
path = "/opt/vault"
node_id = "us-west-1"
Expand All @@ -9,13 +6,3 @@ storage "raft" {
service_registration "consul" {
address = "192.168.61.10:8500"
}

listener "tcp" {
tls_disable = true
address = "192.168.60.10:8200"
cluster_address = "192.168.60.10:8201"

telemetry {
unauthenticated_metrics_access = true
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
bind_addr = "192.168.61.10"
client_addr = "192.168.61.10"
7 changes: 0 additions & 7 deletions uploads/us/us-west-1/192.168.61.10/nomad/config/overrides.hcl
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
region = "us"
datacenter = "us-west-1"

bind_addr = "192.168.61.10"

consul {
address = "192.168.61.10:8500"
}

vault {
enabled = true
address = "http://192.168.60.10:8200"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
bind_addr = "192.168.60.20"
client_addr = "192.168.60.20"
7 changes: 0 additions & 7 deletions uploads/us/us-west-2/192.168.60.20/nomad/config/overrides.hcl
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
region = "us"
datacenter = "us-west-2"

bind_addr = "192.168.60.20"

consul {
address = "192.168.60.20:8500"
}

vault {
enabled = true
address = "http://192.168.60.20:8200"
Expand Down
13 changes: 0 additions & 13 deletions uploads/us/us-west-2/192.168.60.20/vault/config/overrides.hcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
api_addr = "http://192.168.60.20:8200"
cluster_addr = "http://192.168.60.20:8201"

storage "raft" {
path = "/opt/vault"
node_id = "us-west-2"
Expand All @@ -9,13 +6,3 @@ storage "raft" {
service_registration "consul" {
address = "192.168.61.20:8500"
}

listener "tcp" {
tls_disable = true
address = "192.168.60.20:8200"
cluster_address = "192.168.60.20:8201"

telemetry {
unauthenticated_metrics_access = true
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
bind_addr = "192.168.61.20"
client_addr = "192.168.61.20"
7 changes: 0 additions & 7 deletions uploads/us/us-west-2/192.168.61.20/nomad/config/overrides.hcl
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
region = "us"
datacenter = "us-west-2"

bind_addr = "192.168.61.20"

consul {
address = "192.168.61.20:8500"
}

vault {
enabled = true
address = "http://192.168.60.20:8200"
Expand Down