2015-09-23 23:38:31 +00:00
|
|
|
variable "ssh_keys" {}
|
2015-09-23 21:18:42 +00:00
|
|
|
|
2015-09-24 17:50:41 +00:00
|
|
|
resource "atlas_artifact" "nomad-digitalocean" {
|
|
|
|
name = "hashicorp/nomad-demo"
|
|
|
|
type = "digitalocean.image"
|
|
|
|
version = "latest"
|
|
|
|
}
|
|
|
|
|
2015-09-24 19:26:17 +00:00
|
|
|
module "statsite" {
|
|
|
|
source = "./statsite"
|
|
|
|
region = "nyc3"
|
|
|
|
ssh_keys = "${var.ssh_keys}"
|
|
|
|
}
|
|
|
|
|
2015-09-23 21:16:36 +00:00
|
|
|
module "servers" {
|
2015-09-23 23:38:31 +00:00
|
|
|
source = "./server"
|
|
|
|
region = "nyc3"
|
2015-09-24 17:50:41 +00:00
|
|
|
image = "${atlas_artifact.nomad-digitalocean.id}"
|
2015-09-23 23:38:31 +00:00
|
|
|
ssh_keys = "${var.ssh_keys}"
|
2015-09-24 19:26:17 +00:00
|
|
|
statsite = "${module.statsite.addr}"
|
2015-09-23 21:16:36 +00:00
|
|
|
}
|
|
|
|
|
2015-09-24 02:02:04 +00:00
|
|
|
module "clients-nyc3" {
|
2015-09-23 23:38:31 +00:00
|
|
|
source = "./client"
|
2015-09-24 02:02:04 +00:00
|
|
|
region = "nyc3"
|
2015-09-24 18:44:51 +00:00
|
|
|
count = 500
|
2015-09-24 17:50:41 +00:00
|
|
|
image = "${atlas_artifact.nomad-digitalocean.id}"
|
2015-09-23 23:38:31 +00:00
|
|
|
servers = "${module.servers.addrs}"
|
|
|
|
ssh_keys = "${var.ssh_keys}"
|
2015-09-23 21:16:36 +00:00
|
|
|
}
|
|
|
|
|
2015-09-24 02:02:04 +00:00
|
|
|
module "clients-ams2" {
|
2015-09-23 23:38:31 +00:00
|
|
|
source = "./client"
|
2015-09-24 02:02:04 +00:00
|
|
|
region = "ams2"
|
2015-09-24 18:44:51 +00:00
|
|
|
count = 500
|
2015-09-24 17:50:41 +00:00
|
|
|
image = "${atlas_artifact.nomad-digitalocean.id}"
|
2015-09-23 23:38:31 +00:00
|
|
|
servers = "${module.servers.addrs}"
|
|
|
|
ssh_keys = "${var.ssh_keys}"
|
2015-09-23 21:16:36 +00:00
|
|
|
}
|
|
|
|
|
2015-09-24 02:02:04 +00:00
|
|
|
module "clients-ams3" {
|
2015-09-23 23:38:31 +00:00
|
|
|
source = "./client"
|
2015-09-24 02:02:04 +00:00
|
|
|
region = "ams3"
|
2015-09-24 18:44:51 +00:00
|
|
|
count = 500
|
2015-09-24 17:50:41 +00:00
|
|
|
image = "${atlas_artifact.nomad-digitalocean.id}"
|
2015-09-23 23:38:31 +00:00
|
|
|
servers = "${module.servers.addrs}"
|
|
|
|
ssh_keys = "${var.ssh_keys}"
|
2015-09-23 21:16:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module "clients-sfo1" {
|
2015-09-23 23:38:31 +00:00
|
|
|
source = "./client"
|
|
|
|
region = "sfo1"
|
2015-09-24 18:44:51 +00:00
|
|
|
count = 500
|
2015-09-24 17:50:41 +00:00
|
|
|
image = "${atlas_artifact.nomad-digitalocean.id}"
|
2015-09-23 23:38:31 +00:00
|
|
|
servers = "${module.servers.addrs}"
|
|
|
|
ssh_keys = "${var.ssh_keys}"
|
2015-09-23 21:16:36 +00:00
|
|
|
}
|
2015-09-24 18:44:29 +00:00
|
|
|
|
2015-09-24 21:15:12 +00:00
|
|
|
output "Nomad Servers" {
|
|
|
|
value = "${join(" ", split(",", module.servers.addrs))}"
|
|
|
|
}
|
|
|
|
|
|
|
|
output "Statsite Server" {
|
|
|
|
value = "${module.statsite.addr}"
|
2015-09-24 18:44:29 +00:00
|
|
|
}
|