mirror of
https://github.com/natelandau/ansible-homelab-config.git
synced 2025-11-17 09:23:40 -05:00
fix: fix nomad configuration
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
{% if 'linode' in group_names %}
|
||||
"retry_join" = [{% for h in groups['linode-cluster'] if hostvars[h].is_consul_server == true %}"{{ hostvars[h].linode_private_ip }}"{% if not loop.last %}, {% endif %}{% endfor %}]
|
||||
{% else %}
|
||||
"retry_join" = [{% for h in groups['lan'] if hostvars[h].is_consul_server == true %}"{{ hostvars[h].ansible_host }}"{% if not loop.last %}, {% endif %}{% endfor %}]
|
||||
"retry_join" = ["{{ rpi1_ip_address }}", "{{ rpi2_ip_address }}", "{{ rpi3_ip_address }}"]
|
||||
{% if is_consul_server %}
|
||||
{% if 'linode' in group_names %}
|
||||
"join_wan" = [{% for h in groups['linode-cluster'] if hostvars[h].is_consul_server == true %}"{{ hostvars[h].ansible_host }}"{% if not loop.last %}, {% endif %}{% endfor %}]
|
||||
@@ -98,9 +98,9 @@
|
||||
{% endif %}
|
||||
|
||||
"acl" = {
|
||||
enabled = false
|
||||
default_policy = "allow"
|
||||
enable_token_persistence = true
|
||||
enabled = false
|
||||
}
|
||||
|
||||
# ----------------------------------------- Cluster Operations
|
||||
|
||||
@@ -5,11 +5,11 @@ datacenter = "{{ datacenter_name }}"
|
||||
|
||||
# ----------------------------------------- Files and Logs
|
||||
data_dir = "{{ nomad_opt_dir_location }}"
|
||||
plugin_dir = "{{ nomad_opt_dir_location }}/plugins"
|
||||
log_level = "warn"
|
||||
log_file = "{{ nomad_opt_dir_location }}/logs/nomad.log"
|
||||
log_rotate_max_files = 5
|
||||
enable_syslog = false
|
||||
log_file = "{{ nomad_opt_dir_location }}/logs/nomad.log"
|
||||
log_level = "warn"
|
||||
log_rotate_max_files = 5
|
||||
plugin_dir = "{{ nomad_opt_dir_location }}/plugins"
|
||||
|
||||
# ----------------------------------------- Networking
|
||||
bind_addr = "0.0.0.0" # the default
|
||||
@@ -53,7 +53,7 @@ consul {
|
||||
"traefik.http.routers.nomad-server.service=nomad-server",
|
||||
"traefik.http.routers.nomad-server.rule=Host(`nomad.{{ homelab_domain_name }}`)",
|
||||
"traefik.http.routers.nomad-server.tls=true",
|
||||
"traefik.http.routers.nomad-server.middlewares=authelia@file,redirectScheme@file",
|
||||
"traefik.http.routers.nomad-server.middlewares=redirectScheme@file",
|
||||
"traefik.http.services.nomad-server.loadbalancer.server.port=4646"
|
||||
]
|
||||
{% endif %}
|
||||
@@ -82,8 +82,9 @@ client {
|
||||
retry_interval = "15s"
|
||||
}
|
||||
{% else %}
|
||||
servers = ["{{ rpi1_ip_address }}", "{{ rpi2_ip_address }}", "{{ rpi3_ip_address }}"]
|
||||
server_join {
|
||||
retry_join = [{% for h in groups['lan'] if hostvars[h].is_nomad_server == true %}"{{ hostvars[h].ansible_host }}"{% if not loop.last %}, {% endif %}{% endfor %}]
|
||||
retry_join = ["{{ rpi1_ip_address }}", "{{ rpi2_ip_address }}", "{{ rpi3_ip_address }}"]
|
||||
retry_max = 3
|
||||
retry_interval = "15s"
|
||||
}
|
||||
@@ -149,7 +150,7 @@ server {
|
||||
raft_protocol = "3"
|
||||
|
||||
server_join {
|
||||
retry_join = [{% for h in groups['lan'] if hostvars[h].is_nomad_server == true %}"{{ hostvars[h].ansible_host }}"{% if not loop.last %}, {% endif %}{% endfor %}]
|
||||
retry_join = ["{{ rpi1_ip_address }}", "{{ rpi2_ip_address }}", "{{ rpi3_ip_address }}"]
|
||||
retry_max = 3
|
||||
retry_interval = "15s"
|
||||
}
|
||||
@@ -157,12 +158,12 @@ server {
|
||||
|
||||
autopilot {
|
||||
cleanup_dead_servers = true
|
||||
disable_upgrade_migration = false
|
||||
enable_custom_upgrades = false
|
||||
enable_redundancy_zones = false
|
||||
last_contact_threshold = "200ms"
|
||||
max_trailing_logs = 250
|
||||
server_stabilization_time = "10s"
|
||||
enable_redundancy_zones = false
|
||||
disable_upgrade_migration = false
|
||||
enable_custom_upgrades = false
|
||||
}
|
||||
|
||||
{% endif %}
|
||||
@@ -175,11 +176,11 @@ client {
|
||||
|
||||
# ----------------------------------------- Telemety
|
||||
telemetry = {
|
||||
collection_interval = "10s"
|
||||
datadog_address = "localhost:8125"
|
||||
filter_default = false
|
||||
publish_allocation_metrics = true
|
||||
publish_node_metrics = true
|
||||
collection_interval = "10s"
|
||||
filter_default = false
|
||||
datadog_address = "localhost:8125"
|
||||
prefix_filter = [
|
||||
"+nomad.client.allocations.running",
|
||||
"+nomad.client.allocations.terminal",
|
||||
@@ -194,7 +195,8 @@ telemetry = {
|
||||
"+nomad.nomad.job_summary.running",
|
||||
"+nomad.nomad.job_summary.complete",
|
||||
"+nomad.nomad.job_summary.lost",
|
||||
"+nomad.nomad.job_summary.failed"]
|
||||
"+nomad.nomad.job_summary.failed"
|
||||
]
|
||||
}
|
||||
|
||||
# ----------------------------------------- Plugins
|
||||
@@ -208,10 +210,9 @@ plugin "docker" {
|
||||
config {
|
||||
allow_caps = ["all"]
|
||||
allow_privileged = true
|
||||
extra_labels = ["job_name"]
|
||||
extra_labels = ["job_name", "job_id", "task_group_name", "task_name", "namespace", "node_name", "node_id"]
|
||||
volumes {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user