-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathtf_cli.nomad.hcl
65 lines (50 loc) · 1.34 KB
/
tf_cli.nomad.hcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
variable "terraform_version" {
type = string
default = "1.5.7"
}
variable "terraform_checksum" {
type = string
default = "c0ed7bc32ee52ae255af9982c8c88a7a4c610485cf1d55feeb037eab75fa082c"
}
job "terraform-cli" {
region = "global"
datacenters = ["eu-west","eu-west-2b","eu-west-2c","eu-west-2","dc1"]
type = "batch"
group "terraform-worker" {
count = 1
task "terraform-ingress-worker.service" {
driver = "raw_exec"
artifact {
source = "https://releases.hashicorp.com/terraform/${var.terraform_version}/terraform_${var.terraform_version}_linux_amd64.zip"
destination = "./tmp/"
options {
# checksum = "sha256:$${var.terraform_checksum}"
}
}
####################################################
template {
data = <<EOF
resource "random_pet" "example" {
}
output "example"{
value = random_pet.example.id
}
EOF
destination = "./tmp/example.tf"
}
####################################################
template {
data = <<EOF
cd ./tmp/
./terraform init
./terraform apply -auto-approve
EOF
destination = "./tmp/run.sh"
}
config {
command = "/usr/bin/bash"
args = ["tmp/run.sh"]
}
}
}
}