Merge "Fix the redis_connection_string for osprofiler and make it generic"

This commit is contained in:
Zuul 2019-06-24 13:08:21 +00:00 committed by Gerrit Code Review
commit 0cbebc4786
4 changed files with 5 additions and 6 deletions

View File

@ -690,7 +690,7 @@ enable_kibana: "{{ 'yes' if enable_central_logging | bool or enable_monasca | bo
#################### ####################
# Redis options # Redis options
#################### ####################
redis_address: "{{ kolla_internal_fqdn }}" redis_connection_string: "redis://{% for host in groups['redis'] %}{% if host == groups['redis'][0] %}admin:{{ redis_master_password }}@{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}?sentinel=kolla{% else %}&sentinel_fallback={{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}{% endif %}{% endfor %}&socket_timeout=60&retry_on_timeout=yes"
#################### ####################
# Osprofiler options # Osprofiler options
@ -698,7 +698,6 @@ redis_address: "{{ kolla_internal_fqdn }}"
# valid values: ["elasticsearch", "redis"] # valid values: ["elasticsearch", "redis"]
osprofiler_backend: "elasticsearch" osprofiler_backend: "elasticsearch"
elasticsearch_connection_string: "elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }}" elasticsearch_connection_string: "elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }}"
redis_connection_string: "redis://:{{ redis_master_password }}@{{ redis_address }}:{{ redis_port }}"
osprofiler_backend_connection_string: "{{ redis_connection_string if osprofiler_backend == 'redis' else elasticsearch_connection_string }}" osprofiler_backend_connection_string: "{{ redis_connection_string if osprofiler_backend == 'redis' else elasticsearch_connection_string }}"
#################### ####################

View File

@ -221,7 +221,7 @@ auth_endpoint = {{ keystone_internal_url }}
[coordination] [coordination]
{% if enable_redis | bool %} {% if enable_redis | bool %}
backend_url = redis://{% for host in groups['redis'] %}{% if host == groups['redis'][0] %}admin:{{ redis_master_password }}@{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}?sentinel=kolla{% else %}&sentinel_fallback={{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}{% endif %}{% endfor %}&socket_timeout=60&retry_on_timeout=yes backend_url = {{ redis_connection_string }}
{% elif enable_etcd | bool %} {% elif enable_etcd | bool %}
# NOTE(jeffrey4l): python-etcd3 module do not support multi endpoint here. # NOTE(jeffrey4l): python-etcd3 module do not support multi endpoint here.
backend_url = etcd3://{{ hostvars[groups['etcd'][0]]['ansible_' + hostvars[groups['etcd'][0]]['api_interface']]['ipv4']['address'] }}:{{ etcd_client_port }} backend_url = etcd3://{{ hostvars[groups['etcd'][0]]['ansible_' + hostvars[groups['etcd'][0]]['api_interface']]['ipv4']['address'] }}:{{ etcd_client_port }}

View File

@ -4,7 +4,7 @@ debug = {{ gnocchi_logging_debug }}
log_dir = /var/log/kolla/gnocchi log_dir = /var/log/kolla/gnocchi
{% if enable_redis | bool %} {% if enable_redis | bool %}
coordination_url = redis://{% for host in groups['redis'] %}{% if host == groups['redis'][0] %}admin:{{ redis_master_password }}@{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}?sentinel=kolla{% else %}&sentinel_fallback={{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}{% endif %}{% endfor %}&socket_timeout=60&retry_on_timeout=yes coordination_url = {{ redis_connection_string }}
{% endif %} {% endif %}
{% if service_name == 'gnocchi-api' %} {% if service_name == 'gnocchi-api' %}
@ -63,7 +63,7 @@ policy_file = {{ gnocchi_policy_file }}
[incoming] [incoming]
{% if gnocchi_incoming_storage == 'redis' %} {% if gnocchi_incoming_storage == 'redis' %}
driver = redis driver = redis
redis_url = redis://{% for host in groups['redis'] %}{% if host == groups['redis'][0] %}admin:{{ redis_master_password }}@{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}?sentinel=kolla{% else %}&sentinel_fallback={{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}{% endif %}{% endfor %}&db=0&socket_timeout=60&retry_on_timeout=yes redis_url = {{ redis_connection_string }}
{% endif %} {% endif %}
[storage] [storage]

View File

@ -76,4 +76,4 @@ connection_string = {{ osprofiler_backend_connection_string }}
{% endif %} {% endif %}
[coordination] [coordination]
backend_url = redis://{% for host in groups['redis'] %}{% if host == groups['redis'][0] %}admin:{{ redis_master_password }}@{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}?sentinel=kolla{% else %}&sentinel_fallback={{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ redis_sentinel_port }}{% endif %}{% endfor %} backend_url = {{ redis_connection_string }}