2 # file: roles/nomad/defaults/main.yaml
5 packages: "{{ packages_base + packages_by_distro[ansible_distribution | lower] + packages_by_arch[ansible_machine] }}"
19 nomad_version: "1.4.3"
20 nomad_architecture_map:
27 nomad_architecture: "{{ nomad_architecture_map[ansible_architecture] }}"
28 nomad_pkg: "nomad_{{ nomad_version }}_linux_{{nomad_architecture}}.zip"
29 nomad_zip_url: "https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version }}_linux_{{nomad_architecture}}.zip"
30 nomad_checksum_file_url: "https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version}}_SHA256SUMS"
31 nomad_force_update: false
34 nomad_inst_dir: "/opt"
35 nomad_bin_dir: "/usr/local/bin"
36 nomad_config_dir: "/etc/nomad.d"
37 nomad_data_dir: "/var/nomad"
38 nomad_plugin_dir: "{{ nomad_data_dir }}/plugins"
39 nomad_lockfile: "/var/lock/subsys/nomad"
40 nomad_run_dir: "/var/run/nomad"
41 nomad_ssl_dir: "/etc/nomad.d/ssl"
43 # Initialization and startup script templates
46 # System user and group
51 nomad_datacenter: "dc1"
52 nomad_region: "global"
53 nomad_log_level: "INFO"
54 nomad_syslog_enable: true
55 nomad_iface: "{{ ansible_default_ipv4.interface }}"
56 nomad_node_name: "{{ inventory_hostname }}"
57 nomad_node_role: "server"
58 nomad_leave_on_terminate: true
59 nomad_leave_on_interrupt: false
60 nomad_disable_update_check: true
61 nomad_enable_debug: false
64 nomad_bootstrap_expect: 2
66 nomad_retry_join: true
67 # Specifies how long a node must be in a terminal state before it is garbage
68 # collected and purged from the system.
69 nomad_node_gc_threshold: "24h"
70 # Specifies the interval between the job garbage collections. Only jobs who have
71 # been terminal for at least job_gc_threshold will be collected.
72 nomad_job_gc_interval: "10m"
73 # Specifies the minimum time a job must be in the terminal state before it is
74 # eligible for garbage collection.
75 nomad_job_gc_threshold: "4h"
76 # Specifies the minimum time an evaluation must be in the terminal state before
77 # it is eligible for garbage collection.
78 nomad_eval_gc_threshold: "1h"
79 # Specifies the minimum time a deployment must be in the terminal state before
80 # it is eligible for garbage collection.
81 nomad_deployment_gc_threshold: "1h"
82 nomad_encrypt_enable: false
83 nomad_raft_protocol: 2
86 nomad_node_class: "compute"
87 nomad_no_host_uuid: true
88 nomad_max_kill_timeout: "30s"
89 nomad_gc_interval: "1m"
90 nomad_gc_disk_usage_threshold: 80
91 nomad_gc_inode_usage_threshold: 70
92 nomad_gc_parallel_destroys: 2
94 cpu: "{{ nomad_reserved_cpu | default('0', true) }}"
95 memory: "{{ nomad_reserved_memory | default('0', true) }}"
96 disk: "{{ nomad_reserved_disk | default('0', true) }}"
97 ports: "{{ nomad_reserved_ports | default('22', true) }}"
101 nomad_chroot_env: false
105 nomad_bind_address: "{{ hostvars[inventory_hostname]['ansible_'+ nomad_iface ]['ipv4']['address'] }}"
106 nomad_advertise_address: "{{ hostvars[inventory_hostname]['ansible_' + nomad_iface]['ipv4']['address'] }}"
110 http: "{{ nomad_ports_http | default('4646', true) }}"
111 rpc: "{{ nomad_ports_rpc | default('4647', true) }}"
112 serf: "{{ nomad_ports_serf | default('4648', true) }}"
115 nomad_group_name: "nomad"
117 {% if nomad_use_consul==false %}\
118 {% set _nomad_servers = [] %}\
119 {% for host in groups[nomad_group_name] %}\
120 {% set _nomad_node_role = hostvars[host]['nomad_node_role'] | default('client', true) %}\
121 {% if (_nomad_node_role == 'server' or _nomad_node_role == 'both') %}\
122 {% if _nomad_servers.append(host) %}{% endif %}\
125 {{ _nomad_servers }}\
129 nomad_gather_server_facts: false
132 nomad_use_consul: true
133 nomad_consul_address: "localhost:8500"
134 nomad_consul_token: ""
135 nomad_consul_servers_service_name: "nomad"
136 nomad_consul_clients_service_name: "nomad-client"
137 nomad_consul_tags: {}
138 nomad_consul_use_ssl: false
141 nomad_acl_enabled: false
142 nomad_acl_token_ttl: "30s"
143 nomad_acl_policy_ttl: "30s"
144 nomad_acl_replication_token: ""
147 nomad_docker_enable: false
148 nomad_docker_dmsetup: true
151 nomad_autopilot_cleanup_dead_servers: true
152 nomad_autopilot_last_contact_threshold: "200ms"
153 nomad_autopilot_max_trailing_logs: 250
154 nomad_autopilot_server_stabilization_time: "10s"
157 nomad_use_telemetry: true
158 nomad_telemetry_disable_hostname: false
159 nomad_telemetry_collection_interval: "1s"
160 nomad_telemetry_use_node_name: false
161 nomad_telemetry_publish_allocation_metrics: true
162 nomad_telemetry_publish_node_metrics: true
163 nomad_telemetry_prometheus_metrics: true
167 nomad_tls_ca_file: "{{ nomad_ssl_dir }}/nomad-ca.pem"
168 nomad_tls_cert_file: "{{ nomad_ssl_dir }}/nomad.pem"
169 nomad_tls_key_file: "{{ nomad_ssl_dir }}/nomad-key.pem"
170 nomad_tls_cli_cert_file: "{{ nomad_ssl_dir }}/nomad-cli.pem"
171 nomad_tls_cli_key_file: "{{ nomad_ssl_dir }}/nomad-cli-key.pem"
172 nomad_tls_http: false
174 nomad_tls_rpc_upgrade_mode: false
175 nomad_tls_verify_https_client: false
176 nomad_tls_verify_server_hostname: false
179 nomad_use_vault: false
180 nomad_vault_address: "http://vault.service.consul:8200"
181 nomad_vault_allow_unauthenticated: true
182 nomad_vault_enabled: false
183 nomad_vault_create_from_role: ""
184 nomad_vault_task_token_ttl: "72h"
185 nomad_vault_use_ssl: false
186 nomad_vault_ca_file: ""
187 nomad_vault_ca_path: ""
188 nomad_vault_cert_file: ""
189 nomad_vault_key_file: ""
190 nomad_vault_namespace: ""
191 nomad_vault_tls_server_name: ""
192 nomad_vault_tls_skip_verify: false
193 nomad_vault_token: ""