---
### Layerops Global Variables
local_bin_path: "/usr/local/bin"
layerops_config_path: "/etc/layerops"
layerops_tls_path: "/etc/layerops/tls"
layerops_tls_ca_file: "/etc/layerops/tls/layerops-ca.pem"
layerops_tls_cert_file: "/etc/layerops/tls/layerops-cert.pem"
layerops_tls_key_file: "/etc/layerops/tls/layerops-key.pem"
layerops_template_path: "/etc/layerops/templates"
layerops_bin_path: "/etc/layerops/scripts"
layerops_launch_script: "{{ layerops_bin_path }}/launch.sh"
layerops_tls_renew_script: "{{ layerops_bin_path }}/ly_tls_renew.sh"
layerops_tls_check_script: "{{ layerops_bin_path }}/ly_tls_check.sh"
layerops_tls_minimum_ttl: "{{ lookup('env','LAYEROPS_TLS_MIN_TTL') | default(2592000, true) | int }}" # default: 30 days
layerops_tls_renew_timer: "{{ lookup('env','LAYEROPS_TLS_RENEW_TIMER') | default('1w', true) }}"
layerops_config_file: "/etc/layerops/config.json"
layerops_api_access_file: "/etc/layerops/api-access.json"
layerops_signature_file: "/data/layerops/.signature"
hashistack_group: bin
layerops_persistent_volume_path: "/data/layerops/persistentSharedVolume"

layerops_update_config_timer: "{{ lookup('env','LAYEROPS_UPDATE_CONFIG_TIMER') | default('1m', true) }}"
layerops_update_config_random_delay: "{{ lookup('env','LAYEROPS_UPDATE_CONFIG_RANDOM_DELAY') | default('55', true) }}"

layerops_curl_user_agent: NimeOps-UA
layerops_user: layerops
layerops_group: layerops
layerops_user_shell: /bin/bash
layerops_home_dir: "/home/{{ layerops_user }}"
layerops_authorized_keys_file: "{{ layerops_home_dir }}/.ssh/authorized_keys"
layerops_sudoers_config_file: /etc/sudoers.d/99-layerops-users

job_scheduler_job_names:
  instance_init: instance_init
  instance_upgrade: instance_upgrade
  instance_tags_update: instance_tags_update

python_packages:
  - jinja2-cli
  - jinja2-ansible-filters

### Systemd Resolved
systemd_resolve_config_dir: /etc/systemd/resolved.conf.d

# HAProxy
haproxy_config_path: /etc/haproxy
haproxy_cert_path: "/etc/haproxy/ssl"
haproxy_allcerts_file: "{{ haproxy_config_path }}/allCerts"
haproxy_template_path: "{{ layerops_template_path }}/haproxy"
haproxy_log_path: "/var/log/haproxy"
haproxy_log_file: "{{ haproxy_log_path }}/haproxy.log"

### Docker
docker_interface: "{{ lookup('env','DOCKER_INTERFACE') | default('docker0', true) }}"
docker_data_path: "{{ lookup('env','DOCKER_DATA_PATH') | default('/data/docker', true) }}"
docker_config_path: "{{ lookup('env','DOCKER_CONFIG_PATH') | default('/etc/docker', true) }}"
docker_bridge_ip: "{{ lookup('env','DOCKER_BRIDGE_IP') | default('172.17.0.1', true) }}"
docker_bridge_ip_mask: "{{ lookup('env','DOCKER_BRIDGE_IP_MASK') | default('16', true) }}"
docker_log_path: "{{ lookup('env','DOCKER_LOG_PATH') | default('/var/log/docker', true) }}"
docker_log_file: "{{ docker_log_path }}/docker.log"
docker_volume_gb_script: /usr/local/bin/layerops-volume-garbage-collector.sh
docker_pretech_script: /usr/local/bin/docker-prefetch.sh
docker_prefetch_images:
  - alpine/curl:{{ lookup('env','DOCKER_CURL_IMAGE_VERSION') | default('3.14', true) }}
  - envoyproxy/envoy:{{ lookup('env','DOCKER_ENVOY_IMAGE_VERSION') | default('v1.25.1', true) }}
  - registry.nimeops.net/layerops-public/marketplace/haproxy:{{ lookup('env','DOCKER_HAPROXY_IMAGE_VERSION') | default('2.8', true) }}
  - registry.nimeops.net/layerops-public/marketplace/heartbeat:{{ lookup('env','DOCKER_HEARTBEAT_IMAGE_VERSION') | default('1.0', true) }}
docker_prefetch_images_orchestrator:
  - grafana/grafana:{{ lookup('env','DOCKER_GRAFANA_IMAGE_VERSION') | default('10.1.10', true) }}
  - grafana/loki:{{ lookup('env','DOCKER_LOKI_IMAGE_VERSION') | default('2.9.4', true) }}
  - prom/alertmanager:{{ lookup('env','DOCKER_ALERTMANAGER_IMAGE_VERSION') | default('v0.24.0', true) }}
  - prom/consul-exporter:{{ lookup('env','DOCKER_CONSUL_EXPORTER_IMAGE_VERSION') | default('v0.8.0', true) }}
  - prom/prometheus:{{ lookup('env','DOCKER_PROMETHEUS_IMAGE_VERSION') | default('v2.42.0', true) }}
  - registry.nimeops.net/layerops-public/marketplace/certbot:{{ lookup('env','DOCKER_CERTBOT_IMAGE_VERSION') | default('2.11.0', true) }}
  - registry.nimeops.net/layerops-public/marketplace/fluentd:{{ lookup('env','DOCKER_FLUENTD_IMAGE_VERSION') | default('1.16-5', true) }}
  - registry.nimeops.net/layerops-public/marketplace/jq:{{ lookup('env','DOCKER_JQ_IMAGE_VERSION') | default('1.6', true) }}
  - registry.nimeops.net/layerops-public/marketplace/orchestrator-snapshot:{{ lookup('env','DOCKER_ORCHESTRATOR_SNAPSHOT_IMAGE_VERSION') | default('1.0.2', true) }}

### Consul
consul_user: consul
consul_version: "{{ lookup('env','CONSUL_VERSION') | default('1.15.8', true) }}"
consul_pkg: "consul_{{ consul_version }}_linux_amd64.zip"
consul_src: "https://releases.hashicorp.com/consul/{{ consul_version }}/{{ consul_pkg }}"
consul_checksum_file_url: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version}}_SHA256SUMS"

consul_template_version: "{{ lookup('env','CONSUL_TEMPLATE_VERSION') | default('0.40.0', true) }}"
consul_template_pkg: "consul-template_{{ consul_template_version }}_linux_amd64.zip"
consul_template_src: "https://releases.hashicorp.com/consul-template/{{ consul_template_version }}/{{ consul_template_pkg }}"
consul_template_checksum_file_url: "https://releases.hashicorp.com/consul-template/{{ consul_template_version }}/consul-template_{{ consul_template_version}}_SHA256SUMS"

consul_config_template_path: "{{ layerops_template_path }}/consul"
consul_data_path: "{{ lookup('env','CONSUL_DATA_PATH') | default('/data/consul', true) }}"
consul_config_path: "{{ lookup('env','CONSUL_CONFIG_PATH') | default('/etc/consul.d', true) }}"
consul_run_path: "{{ lookup('env','CONSUL_RUN_PATH') | default('/run/consul', true) }}"
consul_log_path: "{{ lookup('env','CONSUL_LOG_PATH') | default('/var/log/consul', true) }}"
consul_log_file: "{{ consul_log_path }}/consul.log"

consul_systemd_restart_sec: "{{ lookup('env','CONSUL_SYSTEMD_RESTART_SEC') | default(42, true) | int }}"
consul_systemd_limit_nofile: "{{ lookup('env','CONSUL_SYSTEMD_LIMIT_NOFILE') | default(65536, true) | int }}"

consul_domain_suffix: "{{ lookup('env','CONSUL_DOMAIN_NODE_SUFFIX') | default('node.consul', true)}}"
consul_dns_ip: 127.0.0.86

### Monitoring
monitoring_user: layerops_monitoring
monitoring_group: layerops_monitoring
monitoring_uid: 10000
monitoring_gid: 10000
monitoring_data_path: /data/monitoring
node_exporter_image: prom/node-exporter:v1.0.1
node_exporter_exposed_port: 9888
node_exporter_listening_port: 9100

### Nomad
nomad_user: root
nomad_version: "{{ lookup('env','NOMAD_VERSION') | default('1.5.12', true) }}"
nomad_pkg: "nomad_{{ nomad_version }}_linux_amd64.zip"
nomad_src: "https://releases.hashicorp.com/nomad/{{ nomad_version }}/{{ nomad_pkg }}"
nomad_checksum_file_url: "https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version}}_SHA256SUMS"
nomad_driver_plugins_version: "{{ lookup('env','NOMAD_DRIVERS_PLUGINS_VERSION') | default('1.0.0', true) }}"
nomad_driver_plugins_src: "https://github.com/containernetworking/plugins/releases/download/v{{ nomad_driver_plugins_version }}/cni-plugins-linux-amd64-v{{ nomad_driver_plugins_version }}.tgz"
nomad_driver_plugins_path: "/opt/cni/bin"

nomad_gb_script: /usr/local/bin/layerops-nomad-garbage-collector.sh

nomad_config_template_path: "{{ layerops_template_path }}/nomad"
nomad_config_path: "{{ lookup('env','NOMAD_CONFIG_PATH') | default('/etc/nomad.d', true) }}"
nomad_data_path: "{{ lookup('env','NOMAD_DATA_PATH') | default('/data/nomad', true) }}"
nomad_data_alloc_path: "{{ lookup('env','NOMAD_DATA_ALLOC_PATH') | default('/data/nomad/alloc', true) }}"
nomad_data_client_path: "{{ lookup('env','NOMAD_DATA_CLIENT_PATH') | default('/data/nomad/client', true) }}"
nomad_data_keyring_path: "{{ lookup('env','NOMAD_DATA_KEYRING_PATH') | default('/data/nomad/server/keystore', true) }}"
nomad_run_path: "{{ lookup('env','NOMAD_RUN_PATH') | default('/var/run/nomad', true) }}"
nomad_log_path: "{{ lookup('env','NOMAD_LOG_PATH') | default('/var/log/nomad', true) }}"
nomad_log_file: "{{ nomad_log_path }}/nomad.log"
nomad_backup_keystores_path: static-secret/nomad/backup/keystore

nomad_client_options:
  docker.volumes.enabled: 1

### Vault
vault_config_template_path: "{{ layerops_template_path }}/vault"
vault_config_path: "{{ lookup('env','VAULT_CONFIG_PATH') | default('/etc/vault.d', true) }}"
vault_data_path: "{{ lookup('env','VAULT_DATA_PATH') | default('/data/vault', true) }}"
vault_log_path: "{{ lookup('env','VAULT_LOG_PATH') | default('/var/log/vault', true) }}"
vault_log_file: "{{ vault_log_path }}/vault.log"

### Volume mount options
default_fs_type: ext4
fstab_options: defaults
fstab_file: /etc/fstab
default_host_volume_path: /data/layerops

### Wireguard
wireguard_template_path: "{{ layerops_template_path }}/wireguard"
wireguard_interface: "{{ lookup('env','WIREGUARD_INTERFACE') | default('wg0', true) }}"
wireguard_config_path: /etc/wireguard
wireguard_config_file: "{{ wireguard_config_path }}/{{ wireguard_interface }}.conf"
wireguard_systemd_config_path: /etc/systemd/system/wg-quick@.service.d
wireguard_service_start_timeout: 30
wireguard_device_mtu: 1200

updates_template_path: "{{ layerops_template_path }}/updates"
