datacenter = "{{ nomad_datacenter }}" name = "{{ vm_name }}" data_dir = "{{ nomad_data_dir }}" bind_addr = "0.0.0.0" advertise { http = "{{ vm_ip }}" rpc = "{{ vm_ip }}" serf = "{{ vm_ip }}" } {% if 'admin' in group_names %} server { enabled = true bootstrap_expect = 3 # uncoment retry_join if bootstrap_expect > 1 retry_join = [{% for host in groups['admin'] %}"{{ hostvars[host]['vm_ip'] }}"{% if not loop.last %},{% endif %}{% endfor %}] } {% endif %} {% if 'client' in group_names %} client { enabled = true servers = [{% for host in groups['admin'] %}"{{ hostvars[host]['vm_ip'] }}"{% if not loop.last %},{% endif %}{% endfor %}] host_network "public" { cidr = "{{ network_cidr }}" } } {% endif %} consul { address = "{{ vm_ip}}:8500" } 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 } } telemetry { collection_interval = "1s" disable_hostname = true prometheus_metrics = true publish_allocation_metrics = true publish_node_metrics = true }