46 lines
1.1 KiB
Django/Jinja
46 lines
1.1 KiB
Django/Jinja
# {{ ansible_managed }}
|
|
# Nomad Agent Configuration
|
|
|
|
datacenter = "{{ nomad_datacenter }}"
|
|
region = "{{ nomad_region }}"
|
|
data_dir = "{{ nomad_data_dir }}"
|
|
log_level = "{{ nomad_log_level }}"
|
|
|
|
bind_addr = "{{ nomad_bind_addr }}"
|
|
|
|
# Advertise addresses
|
|
advertise {
|
|
http = "{{ ansible_default_ipv4.address }}:4646"
|
|
rpc = "{{ ansible_default_ipv4.address }}:4647"
|
|
serf = "{{ ansible_default_ipv4.address }}:4648"
|
|
}
|
|
|
|
# Consul integration
|
|
consul {
|
|
address = "{{ nomad_consul_address }}"
|
|
auto_advertise = {{ nomad_consul_auto_advertise | lower }}
|
|
server_auto_join = {{ nomad_consul_server_auto_join | lower }}
|
|
client_auto_join = {{ nomad_consul_client_auto_join | lower }}
|
|
|
|
# Service registration
|
|
server_service_name = "nomad"
|
|
client_service_name = "nomad-client"
|
|
}
|
|
|
|
{% if nomad_vault_enabled %}
|
|
# Vault integration
|
|
vault {
|
|
enabled = true
|
|
address = "{{ nomad_vault_address }}"
|
|
}
|
|
{% endif %}
|
|
|
|
# Telemetry (for Prometheus)
|
|
telemetry {
|
|
collection_interval = "10s"
|
|
disable_hostname = true
|
|
prometheus_metrics = true
|
|
publish_allocation_metrics = true
|
|
publish_node_metrics = true
|
|
}
|