feat(ansible): Migrate Ubuntu Jammy II
[csit.git] / fdio.infra.ansible / roles / nomad / defaults / main.yaml
1 ---
2 # file: roles/nomad/defaults/main.yaml
3
4 # Prerequisites
5 packages: "{{ packages_base + packages_by_distro[ansible_distribution | lower] + packages_by_arch[ansible_machine] }}"
6 packages_base:
7   - "curl"
8   - "unzip"
9 packages_by_distro:
10   ubuntu:
11     - []
12 packages_by_arch:
13   aarch64:
14     - []
15   x86_64:
16     - []
17
18 # Package
19 nomad_version: "{{ lookup('env','NOMAD_VERSION') | default('1.3.1', true) }}"
20 nomad_architecture_map:
21   amd64: "amd64"
22   x86_64: "amd64"
23   armv7l: "arm"
24   aarch64: "arm64"
25   32-bit: "386"
26   64-bit: "amd64"
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_podman_enable: false
32 nomad_podman_version: "{{ lookup('env','NOMAD_PODMAN_VERSION') | default('0.1.0', true) }}"
33 nomad_podman_pkg: "nomad-driver-podman_{{ nomad_podman_version }}_linux_{{nomad_architecture}}.zip"
34 nomad_podman_url: "https://releases.hashicorp.com/nomad-driver-podman/{{ nomad_podman_version }}"
35 nomad_podman_zip_url: "{{ nomad_podman_url }}/{{ nomad_podman_pkg }}"
36 nomad_podman_checksum_file_url: "{{ nomad_podman_url }}/nomad-driver-podman_{{ nomad_podman_version }}_SHA256SUMS"
37 nomad_force_update: false
38
39 # Paths
40 nomad_inst_dir: "/opt"
41 nomad_bin_dir: "/usr/local/bin"
42 nomad_config_dir: "/etc/nomad.d"
43 nomad_data_dir: "/var/nomad"
44 nomad_plugin_dir: "{{ nomad_data_dir }}/plugins"
45 nomad_lockfile: "/var/lock/subsys/nomad"
46 nomad_run_dir: "/var/run/nomad"
47 nomad_ssl_dir: "/etc/nomad.d/ssl"
48
49 # Initialization and startup script templates
50 nomad_restart_handler_state: "restarted"
51 nomad_service_mgr: ""
52
53 # System user and group
54 nomad_group: "nomad"
55 nomad_group_state: "present"
56 nomad_user: "nomad"
57 nomad_user_state: "present"
58
59 # Nomad settings
60 nomad_datacenter: "dc1"
61 nomad_region: "global"
62 nomad_log_level: "INFO"
63 nomad_syslog_enable: true
64 nomad_iface: "{{ lookup('env','NOMAD_IFACE') | default(ansible_default_ipv4.interface, true) }}"
65 nomad_node_name: "{{ inventory_hostname }}"
66 nomad_node_role: "{{ lookup('env','NOMAD_NODE_ROLE') | default('server', true) }}"
67 nomad_leave_on_terminate: true
68 nomad_leave_on_interrupt: false
69 nomad_disable_update_check: true
70 nomad_enable_debug: false
71
72 # Server settings
73 nomad_bootstrap_expect: 2
74 nomad_encrypt: ""
75 nomad_retry_join: true
76 # Specifies how long a node must be in a terminal state before it is garbage
77 # collected and purged from the system.
78 nomad_node_gc_threshold: "24h"
79 # Specifies the interval between the job garbage collections. Only jobs who have
80 # been terminal for at least job_gc_threshold will be collected.
81 nomad_job_gc_interval: "10m"
82 # Specifies the minimum time a job must be in the terminal state before it is
83 # eligible for garbage collection.
84 nomad_job_gc_threshold: "4h"
85 # Specifies the minimum time an evaluation must be in the terminal state before
86 # it is eligible for garbage collection.
87 nomad_eval_gc_threshold: "1h"
88 # Specifies the minimum time a deployment must be in the terminal state before
89 # it is eligible for garbage collection.
90 nomad_deployment_gc_threshold: "1h"
91 nomad_encrypt_enable: "{{ lookup('env','NOMAD_ENCRYPT_ENABLE') | default('false', true) }}"
92 nomad_raft_protocol: 2
93
94 # Client settings
95 nomad_node_class: "compute"
96 nomad_no_host_uuid: true
97 nomad_max_kill_timeout: "30s"
98 nomad_gc_interval: "1m"
99 nomad_gc_disk_usage_threshold: 80
100 nomad_gc_inode_usage_threshold: 70
101 nomad_gc_parallel_destroys: 2
102 nomad_reserved:
103   cpu: "{{ nomad_reserved_cpu | default('0', true) }}"
104   memory: "{{ nomad_reserved_memory | default('0', true) }}"
105   disk: "{{ nomad_reserved_disk | default('0', true) }}"
106   ports: "{{ nomad_reserved_ports | default('22', true) }}"
107 nomad_volumes: []
108 nomad_options: {}
109 nomad_meta: {}
110 nomad_chroot_env: false
111 nomad_plugins: {}
112
113 # Addresses
114 nomad_bind_address: "{{ hostvars[inventory_hostname]['ansible_'+ nomad_iface ]['ipv4']['address'] }}"
115 nomad_advertise_address: "{{ hostvars[inventory_hostname]['ansible_' + nomad_iface]['ipv4']['address'] }}"
116
117 # Ports
118 nomad_ports:
119   http: "{{ nomad_ports_http | default('4646', true) }}"
120   rpc: "{{ nomad_ports_rpc | default('4647', true) }}"
121   serf: "{{ nomad_ports_serf | default('4648', true) }}"
122
123 # Servers
124 nomad_group_name: "nomad"
125 nomad_servers: "\
126   {% if nomad_use_consul==false %}\
127     {% set _nomad_servers = [] %}\
128     {% for host in groups[nomad_group_name] %}\
129       {% set _nomad_node_role = hostvars[host]['nomad_node_role'] | default('client', true) %}\
130       {% if ( _nomad_node_role == 'server' or _nomad_node_role == 'both') %}\
131         {% if _nomad_servers.append(host) %}{% endif %}\
132       {% endif %}\
133     {% endfor %}\
134     {{ _nomad_servers }}\
135     {% else %}\
136     []\
137   {% endif %}"
138 nomad_gather_server_facts: false
139
140 # Consul
141 nomad_use_consul: true
142 nomad_consul_address: "localhost:8500"
143 nomad_consul_token: ""
144 nomad_consul_servers_service_name: "nomad"
145 nomad_consul_clients_service_name: "nomad-client"
146 nomad_consul_tags: {}
147
148 # ACLs
149 nomad_acl_enabled: "{{ lookup('env', 'NOMAD_ACL_ENABLED') | default('no', true) }}"
150 nomad_acl_token_ttl: "30s"
151 nomad_acl_policy_ttl: "30s"
152 nomad_acl_replication_token: ""
153
154 # Vault
155 nomad_vault_enabled: "{{ lookup('env', 'NOMAD_VAULT_ENABLED') | default('no', true) }}"
156 nomad_vault_address: "{{ vault_address | default('0.0.0.0', true) }}"
157 nomad_vault_allow_unauthenticated: true
158 nomad_vault_create_from_role: ""
159 nomad_vault_task_token_ttl: ""
160 nomad_vault_ca_file: ""
161 nomad_vault_ca_path: ""
162 nomad_vault_cert_file: ""
163 nomad_vault_key_file: ""
164 nomad_vault_tls_server_name: ""
165 nomad_vault_tls_skip_verify: false
166 nomad_vault_token: ""
167 nomad_vault_namespace: ""
168
169 # Docker
170 nomad_docker_enable: "{{ lookup('env','NOMAD_DOCKER_ENABLE') | default('false', true) }}"
171 nomad_docker_dmsetup: true
172
173 # TLS
174 nomad_tls_enable: true
175 nomad_ca_file: "{{ nomad_ssl_dir }}/nomad-ca.pem"
176 nomad_cert_file: "{{ nomad_ssl_dir }}/nomad.pem"
177 nomad_key_file: "{{ nomad_ssl_dir }}/nomad-key.pem"
178 nomad_cli_cert_file: "{{ nomad_ssl_dir }}/nomad-cli.pem"
179 nomad_cli_key_file: "{{ nomad_ssl_dir }}/nomad-cli-key.pem"
180 nomad_http: false
181 nomad_rpc: false
182 nomad_rpc_upgrade_mode: false
183 nomad_verify_server_hostname: false
184 nomad_verify_https_client: false
185
186 # Conf - autopilot.hcl
187 nomad_autopilot_cleanup_dead_servers: true
188 nomad_autopilot_last_contact_threshold: "200ms"
189 nomad_autopilot_max_trailing_logs: 250
190 nomad_autopilot_server_stabilization_time: "10s"
191
192 # Telemetry
193 nomad_telemetry: true
194 nomad_telemetry_disable_hostname: false
195 nomad_telemetry_collection_interval: 60s
196 nomad_telemetry_use_node_name: false
197 nomad_telemetry_publish_allocation_metrics: true
198 nomad_telemetry_publish_node_metrics: true
199 nomad_telemetry_prometheus_metrics: true