data_dir = "{{ nomad_data_dir}}" bind_addr = "{{ nomad_bind_addr }}" datacenter = "{{ nomad_datacenter }}" server { enabled = {{ nomad_server |lower }} bootstrap_expect = {{ nomad_bootstrap_expect }} } client { enabled = true {% if nomad_client_network_interface %} network_interface = "{{ nomad_client_network_interface }}" {% endif %} {% if nomad_client_cpu_total_compute %} cpu_total_compute: {{ nomad_client_cpu_total_compute}} {% endif %} {% if nomad_client_meta %} meta { {% for meta in nomad_client_meta %} {{meta["name"]}} = "{{meta["value"]}}" {% endfor %} } {% endif %} {% if nomad_node_class %} node_class = "{{nomad_node_class}}" {% endif %} {% if nomad_node_pool %} node_pool = "{{nomad_node_pool}}" {% endif %} {% for nomad_host_volume in nomad_host_volumes %} host_volume "{{ nomad_host_volume['name'] }}" { path = "{{ nomad_host_volume['path'] }}" read_only = {{ nomad_host_volume['read_only'] | bool | lower }} } {% endfor %} {% for nomad_host_network in nomad_host_networks %} host_network "{{ nomad_host_network['name'] }}" { {% if 'cidr' in nomad_host_network %} cidr = "{{ nomad_host_network['cidr'] | default}}" {% else %} interface = "{{ nomad_host_network['interface'] }}" {% endif %} {% if "reserved_ports" in nomad_host_network %} reserved_ports = "{{ nomad_host_network['reserved_ports'] }}" {% endif %} } {% endfor %} } plugin "raw_exec" { config { enabled = true } } plugin "docker"{ config{ volumes { enabled = true selinuxlabel = "z" } {%if 'nomad_docker_allow_caps' %} allow_caps = [ "{{nomad_docker_default_caps|join('","')}}","{{nomad_docker_allow_caps|join('","')}}"] {% endif %} {%if 'nomad_docker_extra_labels' %} extra_labels = [ "{{nomad_docker_extra_labels|join('","')}}" ] {% endif %} allow_privileged = {{ nomad_allow_privileged|lower }} } } {% if 'nomad_plugins_podman' %} plugin "nomad-driver-podman" { config { volumes { enabled = true } } } {% endif %} consul { address = "127.0.0.1:8500" } telemetry { collection_interval = "5s", publish_allocation_metrics = true, publish_node_metrics = true, prometheus_metrics = true } {% if nomad_vault_enabled %} vault { enabled = true address = "{{ nomad_vault_address}}" create_from_role = "{{ nomad_vault_role }}" {% if nomad_server %} token = "{{ nomad_vault_token }}" namespace = "{{ nomad_vault_namespace}}" task_token_ttl = "{{ nomad_vault_token_ttl }}" {% endif %} } {% endif %}