demo/digitalocean: server bootstrap works, client join works
This commit is contained in:
parent
177a7716f2
commit
b208e6bc5f
|
@ -1,6 +1,6 @@
|
|||
datacenter = "${datacenter}"
|
||||
client {
|
||||
enabled = true
|
||||
servers = [ ${join(",", formatlist("\"%s:4647\"", servers))} ]
|
||||
servers = [${join(",", formatlist("\"%s:4647\"", servers))}]
|
||||
node_class = "linux-64bit"
|
||||
}
|
|
@ -6,7 +6,7 @@ variable "servers" {}
|
|||
variable "ssh_keys" {}
|
||||
|
||||
resource "template_file" "client_config" {
|
||||
filename = "templates/client.hcl.tpl"
|
||||
filename = "${path.module}/client.hcl.tpl"
|
||||
vars {
|
||||
datacenter = "${var.region}"
|
||||
servers = "${split(",", var.servers)}"
|
||||
|
@ -30,6 +30,6 @@ CMD
|
|||
}
|
||||
|
||||
provisioner "remote-exec" {
|
||||
inline = "sudo restart nomad || true"
|
||||
inline = "sudo start nomad || sudo restart nomad"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,16 @@ module "servers" {
|
|||
ssh_keys = "${var.ssh_keys}"
|
||||
}
|
||||
|
||||
module "clients-nyc3" {
|
||||
source = "./client"
|
||||
region = "nyc3"
|
||||
count = 1
|
||||
image = "${var.image}"
|
||||
servers = "${module.servers.addrs}"
|
||||
ssh_keys = "${var.ssh_keys}"
|
||||
}
|
||||
|
||||
/*
|
||||
module "clients-ams2" {
|
||||
source = "./client"
|
||||
region = "ams2"
|
||||
|
@ -27,15 +37,6 @@ module "clients-ams3" {
|
|||
ssh_keys = "${var.ssh_keys}"
|
||||
}
|
||||
|
||||
module "clients-nyc3" {
|
||||
source = "./client"
|
||||
region = "nyc3"
|
||||
count = 1
|
||||
image = "${var.image}"
|
||||
servers = "${module.servers.addrs}"
|
||||
ssh_keys = "${var.ssh_keys}"
|
||||
}
|
||||
|
||||
module "clients-sfo1" {
|
||||
source = "./client"
|
||||
region = "sfo1"
|
||||
|
@ -44,3 +45,4 @@ module "clients-sfo1" {
|
|||
servers = "${module.servers.addrs}"
|
||||
ssh_keys = "${var.ssh_keys}"
|
||||
}
|
||||
*/
|
||||
|
|
|
@ -29,7 +29,7 @@ CMD
|
|||
}
|
||||
|
||||
provisioner "remote-exec" {
|
||||
inline = "sudo restart nomad || true"
|
||||
inline = "sudo start nomad || sudo restart nomad"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue