# WARNING: This file is managed by bifrost.
clouds:
{% if (enable_keystone | default(false) | bool) %}
{% for cloud in clouds | default({}) | dictsort %}
  {{ cloud.0 }}:
    auth_type: "password"
    region_name: {{ cloud.1.config_region_name }}
    auth:
      username: "{{ cloud.1.config_username }}"
      password: "{{ cloud.1.config_password }}"
      auth_url: {{ cloud.1.config_auth_url }}
      user_domain_id: "{{ cloud.1.config_user_domain_id | default('default') }}"
{% if cloud.1.config_system_scope | default(false) | bool %}
      system_scope: "all"
{% else %}
      project_name: "{{ cloud.1.config_project_name }}"
      project_domain_id: "{{ cloud.1.config_project_domain_id | default('default') }}"
{% endif %}
    identity_api_version: "3"
{% if enable_tls | bool %}
    cacert: "{{ tls_certificate_path }}"
{% endif %}
{% endfor %}
{% elif noauth_mode | default(false) | bool %}
  bifrost:
    auth_type: "none"
    auth:
      endpoint: {{ ironic_api_url }}
    baremetal_introspection_endpoint_override: {{ ironic_inspector_api_url }}
{% if enable_tls | bool %}
    cacert: "{{ tls_certificate_path }}"
{% endif %}
  # Deprecated
  bifrost-inspector:
    auth_type: "none"
    auth:
      endpoint: {{ ironic_inspector_api_url }}
{% if enable_tls | bool %}
    cacert: "{{ tls_certificate_path }}"
{% endif %}
{% else %}
  bifrost:
    auth_type: "http_basic"
    auth:
      username: "{{ default_username }}"
      password: "{{ default_password }}"
      endpoint: {{ ironic_api_url }}
    baremetal_introspection_endpoint_override: {{ ironic_inspector_api_url }}
{% if enable_tls | bool %}
    cacert: "{{ tls_certificate_path }}"
{% endif %}
  bifrost-admin:
    auth_type: "http_basic"
    auth:
      username: "{{ admin_username }}"
      password: "{{ admin_password }}"
      endpoint: {{ ironic_api_url }}
    baremetal_introspection_endpoint_override: {{ ironic_inspector_api_url }}
{% if enable_tls | bool %}
    cacert: "{{ tls_certificate_path }}"
{% endif %}
{% endif %}
