add host_network and volume

This commit is contained in:
vincent 2022-04-09 09:43:51 +02:00
parent 8502bbef91
commit f126c12961
2 changed files with 30 additions and 0 deletions

View File

@ -10,3 +10,14 @@ nomad_vault_token_ttl: "1h"
nomad_vault_namespace: "" nomad_vault_namespace: ""
nomad_vault_role: "nomad-cluster" nomad_vault_role: "nomad-cluster"
nomad_vault_token: "" nomad_vault_token: ""
nomad_host_volumes:
[]
# - name:
# path:
# read_only:
nomad_host_networks:
[]
# - name:
# cidr:
# interface:
# reserved_ports:

View File

@ -9,6 +9,25 @@ enabled = {{ nomad_server |lower }}
client { client {
enabled = true enabled = true
{% 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" { plugin "raw_exec" {