demo/digitalocean: server bootstrap works, client join works

This commit is contained in:
Ryan Uber 2015-09-23 19:02:04 -07:00
parent 177a7716f2
commit b208e6bc5f
4 changed files with 15 additions and 13 deletions

View file

@ -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"
}

View file

@ -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"
}
}

View file

@ -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}"
}
*/

View file

@ -29,7 +29,7 @@ CMD
}
provisioner "remote-exec" {
inline = "sudo restart nomad || true"
inline = "sudo start nomad || sudo restart nomad"
}
}