ansible-roles/roles/nomad/defaults/main.yml

68 lines
2.3 KiB
YAML

---
# Version of Nomad to install
nomad_version: 1.3.2
# URL of the archive
nomad_archive_url: https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version }}_linux_amd64.zip
# Expected sha256 of the archive
nomad_archive_sha256: fc6b3800935c621633d98148ea30737ab8ac1f698020f45b28b07ac61fbf4a96
# Root dir where Nomad will be installed
nomad_root_dir: /opt/nomad
# user under which nomad will run.
# Servers can run under an unprivileged user, while clients should run as root (or with equivalent privileges)
nomad_user: "{{ nomad_conf.client.enabled | ternary('root', 'nomad') }}"
# List of nomad servers (not clients)
nomad_servers: []
# Ports used by Nomad, the protocols, and the list of IP/CIDR for which the ports will be opened in the firewall
nomad_base_services:
http_api:
port: "{{ nomad_conf.ports.http | default(4646) }}"
proto: [tcp]
src_ip: []
rpc:
port: "{{ nomad_conf.ports.rpc | default(4647) }}"
proto: [tcp]
src_ip: []
serf:
port: "{{ nomad_conf.ports.serf | default(4648) }}"
proto: [tcp,udp]
src_ip: []
nomad_extra_services: {}
nomad_services: "{{ nomad_base_services | combine(nomad_extra_services, recursive=True) }}"
# Nomad configuration (which will be converted to JSON)
# The configuration is splited in a base conf, an extra conf, and a host conf so you can override part of the config easily
nomad_base_conf:
name: "{{ inventory_hostname }}"
data_dir: "{{ nomad_root_dir }}/data"
log_level: INFO
bind_addr: 0.0.0.0
client:
enabled: "{{ (inventory_hostname in nomad_servers) | ternary(False, True) }}"
servers: "{{ (inventory_hostname in nomad_servers) | ternary([], nomad_servers) }}"
server:
enabled: "{{ (inventory_hostname in nomad_servers) | ternary(True, False) }}"
server_join:
retry_join: "{{ (inventory_hostname in nomad_servers) | ternary(nomad_servers, []) }}"
bootstrap_expect: "{{ nomad_servers | length }}"
# For example
# nomad_extra_conf:
# datacenter: my-dc
# server:
# encrypt: umizzu2vi9VaYwdRiOjDXgZIjV8AJ2AV+prqaAhElz0=
# ui_config:
# enabled: True
#
nomad_extra_conf: {}
# Host conf is just another level of configuration override
nomad_host_conf: {}
# Merge all the conf
nomad_conf: "{{ nomad_base_conf | combine(nomad_extra_conf, recursive=True) | combine(nomad_host_conf, recursive=True) }}"