You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.5 KiB
Plaintext
72 lines
1.5 KiB
Plaintext
2 years ago
|
data_dir = "/opt/nomad"
|
||
|
datacenter = "{{ datacenter }}"
|
||
|
|
||
|
|
||
|
bind_addr = "0.0.0.0"
|
||
|
|
||
|
advertise {
|
||
|
# Defaults to the first private IP address.
|
||
|
#http = "1.2.3.4"
|
||
|
#rpc = "1.2.3.4"
|
||
|
#serf = "1.2.3.4:5648" # non-default ports may be specified
|
||
|
}
|
||
|
|
||
|
{# TODO: Get interface-ip from hosts marked with type=server #}
|
||
|
{% set server_hosts = ansible_play_batch | difference([inventory_hostname]) %}
|
||
|
{% if type is defined and type == "server" %}
|
||
|
server {
|
||
|
enabled = true
|
||
|
bootstrap_expect = {{ server_hosts | length }}
|
||
|
|
||
|
server_join {
|
||
|
retry_join = [ "{{ server_hosts | join('", "') }}" ]
|
||
|
retry_max = 6
|
||
|
retry_interval = "15s"
|
||
|
}
|
||
|
|
||
|
default_scheduler_config {
|
||
|
scheduler_algorithm = "binpack"
|
||
|
memory_oversubscription_enabled = true
|
||
|
reject_job_registration = false
|
||
|
pause_eval_broker = false # New in Nomad 1.3.2
|
||
|
|
||
|
preemption_config {
|
||
|
batch_scheduler_enabled = true
|
||
|
system_scheduler_enabled = true
|
||
|
service_scheduler_enabled = true
|
||
|
sysbatch_scheduler_enabled = true # New in Nomad 1.2
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
{% endif %}
|
||
|
|
||
|
client {
|
||
|
enabled = true
|
||
|
|
||
|
{% if type != "server" %}
|
||
|
servers = [ "{{ server_hosts | join('", "') }}" ]
|
||
|
{% endif %}
|
||
|
|
||
|
meta {
|
||
|
node_type = "{{ type }}"
|
||
|
{% if storage is defined and storage %}
|
||
|
seaweedfs_volume = "true"
|
||
|
{% endif %}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
plugin "raw_exec" {
|
||
|
config {
|
||
|
enabled = true
|
||
|
}
|
||
|
}
|
||
|
|
||
|
plugin "docker" {
|
||
|
config {
|
||
|
{% if type is defined and type == "server" %}
|
||
|
allow_privileged = true
|
||
|
{% endif %}
|
||
|
}
|
||
|
}
|