ansible-hashistack/roles/nomad/templates/nomad.hcl.j2

62 lines
1.3 KiB
Plaintext
Raw Normal View History

2023-09-18 17:03:08 +02:00
datacenter = "{{ nomad_datacenter }}"
data_dir = "{{ nomad_data_dir }}"
bind_addr = "0.0.0.0"
2023-09-18 17:03:08 +02:00
name = "{{ vm_name }}"
{% if 'admin' in group_names %}
server {
enabled = true
bootstrap_expect = 1
# uncoment retry_join if bootstrap_expect > 1
# retry_join = [{% for host in groups['admin'] %}"{{ hostvars[host]['vm_ip'] }}"{% if not loop.last %},{% endif %}{% endfor %}]
2023-09-18 17:03:08 +02:00
}
{% endif %}
{% if 'client' in group_names %}
2023-09-18 17:03:08 +02:00
client {
enabled = true
servers = [{% for host in groups['admin'] %}"{{ hostvars[host]['vm_ip'] }}"{% if not loop.last %},{% endif %}{% endfor %}]
2023-09-18 17:03:08 +02:00
host_network "public" {
cidr = "{{ network_cidr }}"
}
}
{% endif %}
2023-09-18 17:03:08 +02:00
consul {
address = "{{ vm_ip}}:8500"
}
2023-09-18 17:03:08 +02:00
plugin "docker" {
config {
volumes {
enabled = true
selinuxlabel = "z"
}
extra_labels = ["job_name", "job_id", "task_group_name", "task_name", "namespace", "node_name", "node_id"]
gc {
image = true
image_delay = "3m"
container = true
dangling_containers {
enabled = true
dry_run = false
period = "5m"
creation_grace = "5m"
}
}
allow_privileged = true
}
}
2023-09-18 17:03:08 +02:00
telemetry {
collection_interval = "1s"
disable_hostname = true
prometheus_metrics = true
publish_allocation_metrics = true
publish_node_metrics = true
}