kolla-ansible/ansible/roles/grafana/defaults/main.yml
Michal Nasiadka 4bc410c6ca haproxy: support single external frontend
Use case: exposing single external https frontend and
load balancing services using FQDNs.

Support different ports for internal and external endpoints.

Introduced kolla_url filter to normalize urls like:
- https://magnum.external:443/v1
- http://magnum.external:80/v1

Change-Id: I9fb03fe1cebce5c7198d523e015280c69f139cd0
Co-Authored-By: Jakub Darmach <jakub@stackhpc.com>
2023-06-29 01:44:00 +02:00

97 lines
3.1 KiB
YAML

---
grafana_services:
grafana:
container_name: grafana
group: grafana
enabled: true
image: "{{ grafana_image_full }}"
volumes: "{{ grafana_default_volumes + grafana_extra_volumes }}"
dimensions: "{{ grafana_dimensions }}"
haproxy:
grafana_server:
enabled: "{{ enable_grafana }}"
mode: "http"
external: false
port: "{{ grafana_server_port }}"
listen_port: "{{ grafana_server_listen_port }}"
grafana_server_external:
enabled: "{{ enable_grafana_external | bool }}"
mode: "http"
external: true
external_fqdn: "{{ grafana_external_fqdn }}"
port: "{{ grafana_server_public_port }}"
listen_port: "{{ grafana_server_listen_port }}"
####################
# Database
####################
grafana_database_name: "grafana"
grafana_database_user: "{% if use_preconfigured_databases | bool and use_common_mariadb_user | bool %}{{ database_user }}{% else %}grafana{% endif %}"
grafana_database_address: "{{ database_address | put_address_in_context('url') }}:{{ database_port }}"
####################
# Database sharding
####################
grafana_database_shard_root_user: "{% if enable_proxysql | bool %}root_shard_{{ grafana_database_shard_id }}{% else %}{{ database_user }}{% endif %}"
grafana_database_shard_id: "{{ mariadb_default_database_shard_id | int }}"
grafana_database_shard:
users:
- user: "{{ grafana_database_user }}"
password: "{{ grafana_database_password }}"
rules:
- schema: "{{ grafana_database_name }}"
shard_id: "{{ grafana_database_shard_id }}"
####################
# Datasource
####################
grafana_data_sources:
influxdb:
enabled: "{{ enable_influxdb | bool }}"
data:
isDefault: yes
database: "telegraf"
name: "telegraf"
type: "influxdb"
url: "{{ influxdb_internal_endpoint }}"
access: "proxy"
basicAuth: false
opensearch:
enabled: "{{ enable_opensearch | bool }}"
data:
name: "opensearch"
type: "grafana-opensearch-datasource"
access: "proxy"
url: "{{ opensearch_internal_endpoint }}"
jsonData:
flavor: "elasticsearch"
database: "[flog-]YYYY.MM.DD"
version: "7.0.0"
timeField: "@timestamp"
##########
# Grafana
##########
grafana_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/grafana"
grafana_tag: "{{ openstack_tag }}"
grafana_image_full: "{{ grafana_image }}:{{ grafana_tag }}"
grafana_admin_username: "admin"
grafana_dimensions: "{{ default_container_dimensions }}"
grafana_default_volumes:
- "{{ node_config_directory }}/grafana/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
- "grafana:/var/lib/grafana/"
- "kolla_logs:/var/log/kolla/"
grafana_extra_volumes: "{{ default_extra_volumes }}"
grafana_start_first_node_delay: 10
grafana_start_first_node_retries: 12
############
# Prometheus
############
grafana_prometheus_url: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ prometheus_port }}"