Update nomad provider
This commit is contained in:
parent
ecda27e05a
commit
a765c320e4
|
@ -15,7 +15,7 @@ Use the navigation to the left to read about the available resources.
|
||||||
|
|
||||||
## Example Usage
|
## Example Usage
|
||||||
|
|
||||||
```
|
```hcl
|
||||||
# Configure the Nomad provider
|
# Configure the Nomad provider
|
||||||
provider "nomad" {
|
provider "nomad" {
|
||||||
address = "nomad.mycompany.com"
|
address = "nomad.mycompany.com"
|
||||||
|
|
|
@ -6,7 +6,7 @@ description: |-
|
||||||
Manages a job registered in Nomad.
|
Manages a job registered in Nomad.
|
||||||
---
|
---
|
||||||
|
|
||||||
# nomad\_job
|
# nomad_job
|
||||||
|
|
||||||
Manages a job registered in Nomad.
|
Manages a job registered in Nomad.
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ type of job, but can be used to manage any job within Nomad.
|
||||||
|
|
||||||
Registering a job from a jobspec file:
|
Registering a job from a jobspec file:
|
||||||
|
|
||||||
```
|
```hcl
|
||||||
resource "nomad_job" "app" {
|
resource "nomad_job" "app" {
|
||||||
jobspec = "${file("${path.module}/job.hcl")}"
|
jobspec = "${file("${path.module}/job.hcl")}"
|
||||||
}
|
}
|
||||||
|
@ -33,31 +33,31 @@ be paired with something such as the
|
||||||
[template_file](https://www.terraform.io/docs/providers/template/d/file.html)
|
[template_file](https://www.terraform.io/docs/providers/template/d/file.html)
|
||||||
resource to render parameterized jobspecs.
|
resource to render parameterized jobspecs.
|
||||||
|
|
||||||
```
|
```hcl
|
||||||
resource "nomad_job" "app" {
|
resource "nomad_job" "app" {
|
||||||
jobspec = <<EOT
|
jobspec = <<EOT
|
||||||
job "foo" {
|
job "foo" {
|
||||||
datacenters = ["dc1"]
|
datacenters = ["dc1"]
|
||||||
type = "service"
|
type = "service"
|
||||||
group "foo" {
|
group "foo" {
|
||||||
task "foo" {
|
task "foo" {
|
||||||
driver = "raw_exec"
|
driver = "raw_exec"
|
||||||
config {
|
config {
|
||||||
command = "/bin/sleep"
|
command = "/bin/sleep"
|
||||||
args = ["1"]
|
args = ["1"]
|
||||||
}
|
}
|
||||||
|
|
||||||
resources {
|
resources {
|
||||||
cpu = 20
|
cpu = 20
|
||||||
memory = 10
|
memory = 10
|
||||||
}
|
}
|
||||||
|
|
||||||
logs {
|
logs {
|
||||||
max_files = 3
|
max_files = 3
|
||||||
max_file_size = 10
|
max_file_size = 10
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
EOT
|
EOT
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue