mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-27 00:05:44 +02:00
Update to 2022-07-29 15:00
This commit is contained in:
34
roles/nomad/templates/nomad.hcl.j2
Normal file
34
roles/nomad/templates/nomad.hcl.j2
Normal file
@@ -0,0 +1,34 @@
|
||||
data_dir = "{{ nomad_root_dir }}/data"
|
||||
log_level = "{{ nomad_log_level }}"
|
||||
bind_addr = "0.0.0.0"
|
||||
advertise {
|
||||
{% for service in nomad_services.keys() | list %}
|
||||
{% if nomad_services[service].advertise is defined %}
|
||||
{{ service }} = {{ nomad_services[service].advertise }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
}
|
||||
ports {
|
||||
{% for service in nomad_services.keys() | list %}
|
||||
{{ service }} = {{ nomad_services[service].port }}
|
||||
{% endfor %}
|
||||
}
|
||||
server {
|
||||
enabled = {{ nomad_server_enabled | ternary('true','false') }}
|
||||
bootstrap_expect = {{ nomad_servers | length }}
|
||||
server_join {
|
||||
retry_join = [
|
||||
{% for server in consul_servers %}
|
||||
"{{ server }}",
|
||||
{% endfor %}
|
||||
]
|
||||
}
|
||||
}
|
||||
client {
|
||||
enabled = {{ nomad_client_enabled | ternary('true','false') }}
|
||||
servers = [
|
||||
{% for server in consul_servers %}
|
||||
"{{ server }}",
|
||||
{% endfor %}
|
||||
]
|
||||
}
|
@@ -3,13 +3,13 @@ Description=Nomad
|
||||
Documentation=https://nomadproject.io/docs/
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
ConditionFileNotEmpty={{ nomad_root_dir }}/etc/nomad.json
|
||||
ConditionFileNotEmpty={{ nomad_root_dir }}/etc/nomad.hcl
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-{{ nomad_root_dir }}/etc/nomad.env
|
||||
User={{ nomad_user }}
|
||||
Group={{ nomad_user }}
|
||||
ExecStart={{ nomad_root_dir }}/bin/nomad agent -config={{ nomad_root_dir }}/etc/
|
||||
ExecStart={{ nomad_root_dir }}/bin/nomad agent -config={{ nomad_root_dir }}/etc/nomad.hcl
|
||||
ExecReload=/bin/kill --signal HUP $MAINPID
|
||||
KillMode=process
|
||||
KillSignal=SIGINT
|
||||
|
Reference in New Issue
Block a user