From b208e6bc5f265217709a60b4c188ab0ab4e2d0fb Mon Sep 17 00:00:00 2001 From: Ryan Uber Date: Wed, 23 Sep 2015 19:02:04 -0700 Subject: [PATCH] demo/digitalocean: server bootstrap works, client join works --- .../{templates => client}/client.hcl.tpl | 2 +- demo/digitalocean/terraform/client/main.tf | 4 ++-- demo/digitalocean/terraform/main.tf | 20 ++++++++++--------- demo/digitalocean/terraform/server/main.tf | 2 +- 4 files changed, 15 insertions(+), 13 deletions(-) rename demo/digitalocean/terraform/{templates => client}/client.hcl.tpl (57%) diff --git a/demo/digitalocean/terraform/templates/client.hcl.tpl b/demo/digitalocean/terraform/client/client.hcl.tpl similarity index 57% rename from demo/digitalocean/terraform/templates/client.hcl.tpl rename to demo/digitalocean/terraform/client/client.hcl.tpl index b4ed03e57..d9bb6c4ee 100644 --- a/demo/digitalocean/terraform/templates/client.hcl.tpl +++ b/demo/digitalocean/terraform/client/client.hcl.tpl @@ -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" } diff --git a/demo/digitalocean/terraform/client/main.tf b/demo/digitalocean/terraform/client/main.tf index e71fdaf09..56d9fdd5e 100644 --- a/demo/digitalocean/terraform/client/main.tf +++ b/demo/digitalocean/terraform/client/main.tf @@ -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" } } diff --git a/demo/digitalocean/terraform/main.tf b/demo/digitalocean/terraform/main.tf index 10367d435..019a51f44 100644 --- a/demo/digitalocean/terraform/main.tf +++ b/demo/digitalocean/terraform/main.tf @@ -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}" } +*/ diff --git a/demo/digitalocean/terraform/server/main.tf b/demo/digitalocean/terraform/server/main.tf index f288732f3..cb82a4460 100644 --- a/demo/digitalocean/terraform/server/main.tf +++ b/demo/digitalocean/terraform/server/main.tf @@ -29,7 +29,7 @@ CMD } provisioner "remote-exec" { - inline = "sudo restart nomad || true" + inline = "sudo start nomad || sudo restart nomad" } }