Browse Source

[ADD] Support for docker

master
Justin Lecher 1 month ago
parent
commit
b5a1dcd426
Signed by: justin GPG Key ID: E9402A79B03529A2
  1. 2
      roles/nomad/defaults/main.yml
  2. 32
      roles/nomad/templates/nomad.hcl.j2

2
roles/nomad/defaults/main.yml

@ -2,7 +2,9 @@
nomad_arch_map:
armv7l: arm
aarch64: arm64
nomad_client: yes
nomad_uses_consul: yes
nomad_server: no
nomad_servers: []
nomad_version: 1.0.1
nomad_client_meta: {}

32
roles/nomad/templates/nomad.hcl.j2

@ -19,7 +19,7 @@ consul {
{% endif %}
client {
enabled = true
enabled = {{ nomad_client | lower }}
servers = {{ nomad_servers | tojson }}
server_join {
retry_join = {{ nomad_servers | tojson }}
@ -34,7 +34,7 @@ client {
}
server {
enabled = true
enabled = {{ nomad_server | lower }}
bootstrap_expect = 3
server_join {
retry_join = {{ nomad_servers | tojson }}
@ -45,7 +45,7 @@ server {
server_join {
retry_join = {{ nomad_servers | tojson }}
retry_max = 3
retry_max = 16
retry_interval = "15s"
}
@ -61,3 +61,29 @@ telemetry {
publish_allocation_metrics = true
publish_node_metrics = true
}
plugin "docker" {
config {
endpoint = "unix:///var/run/docker.sock"
gc {
image = true
image_delay = "3m"
container = true
dangling_containers {
enabled = true
dry_run = false
period = "5m"
creation_grace = "5m"
}
}
volumes {
enabled = true
}
{# allow_privileged = false #}
allow_caps = ["ALL"]
}
}
Loading…
Cancel
Save