---

# TODO variable shouldn't used in a global way
elastic_id: "{{ inventory_hostname }}-elastic"
# TODO variable shouldn't used in a global way
elastic_exporter_id: "{{ inventory_hostname }}-elastic-exporter"

shared_service_url_harbor: "https://{{ shared_service_hostname_harbor }}"
shared_service_hostname_harbor: "{{ stage }}-harbor-01.{{ domain_env }}"

shared_service_url_kibana: "https://{{ shared_service_hostname_kibana }}"
shared_service_hostname_kibana: "{{ stage }}-elastic-stack-kibana-01-kibana.{{ domain_env }}"

shared_service_url_keycloak: "https://{{ shared_service_hostname_keycloak }}"
shared_service_hostname_keycloak: "{{ stage }}-keycloak-01.{{ domain_env }}"

shared_service_host_management: "{{ stage }}-management-01"
shared_service_url_management: "https://{{ shared_service_hostname_management }}"
shared_service_hostname_management: "{{ shared_service_host_management }}-connect.{{ domain_env }}"

# use private loadbalancer ip for all kubernetes services
stage_kube: "{{ stage }}"
shared_service_kube_argocd_hostname: "{{ stage_kube }}-argocd.{{ domain_env }}"
shared_service_kube_url_awx: "https://{{ shared_service_kube_awx_hostname }}"
shared_service_kube_awx_hostname: "{{ stage_kube }}-awx.{{ domain_env }}"
shared_service_kube_harbor_hostname: "{{ stage }}-harbor.{{ domain_env }}"
shared_service_kube_jaeger_collector_hostname: "{{ stage_kube }}-jaeger-collector.{{ domain_env }}"
shared_service_kube_prometheus_hostname: "{{ stage_kube }}-prometheus.{{ domain_env }}"

# TODO make value available for plays with static inventory - by autodiscover_pre_tasks.yml
shared_service_kube_loadbalancer_public_ip_not_available: "public loadbalancer ip not available"
shared_service_kube_loadbalancer_public_ip: "{{ stage_public_ingress_loadbalancer_ip | default(shared_service_kube_loadbalancer_public_ip_not_available) }}"
# TODO make value available for plays with static inventory - by autodiscover_pre_tasks.yml
shared_service_kube_loadbalancer_private_ip_not_available: "private loadbalancer ip not available"
shared_service_kube_loadbalancer_private_ip: "{{ stage_private_ingress_loadbalancer_ip | default(shared_service_kube_loadbalancer_private_ip_not_available) }}"

shared_service_additional_hosts:
  - name: "{{ shared_service_kube_argocd_hostname }}"
    ip: "{{ shared_service_kube_loadbalancer_private_ip }}"
  - name: "{{ shared_service_kube_awx_hostname }}"
    ip: "{{ shared_service_kube_loadbalancer_private_ip }}"
  - name: "{{ shared_service_kube_prometheus_hostname }}"
    ip: "{{ shared_service_kube_loadbalancer_private_ip }}"
  - name: "{{ shared_service_kube_jaeger_collector_hostname }}"
    ip: "{{ shared_service_kube_loadbalancer_private_ip }}"
  - name: "{{ shared_service_kube_harbor_hostname }}"
    ip: "{{ shared_service_kube_loadbalancer_private_ip }}"
