diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 980c213710..e30a117106 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -681,7 +681,7 @@ enable_kibana: "{{ 'yes' if enable_central_logging | bool or enable_monasca | bo #################### # 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 @@ -689,7 +689,6 @@ redis_address: "{{ kolla_internal_fqdn }}" # valid values: ["elasticsearch", "redis"] osprofiler_backend: "elasticsearch" 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 }}" #################### diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2 index 789010084f..5b131c1027 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -221,7 +221,7 @@ auth_endpoint = {{ keystone_internal_url }} [coordination] {% 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 %} # 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 }} diff --git a/ansible/roles/gnocchi/templates/gnocchi.conf.j2 b/ansible/roles/gnocchi/templates/gnocchi.conf.j2 index 9308e74c6c..98a607fa4f 100644 --- a/ansible/roles/gnocchi/templates/gnocchi.conf.j2 +++ b/ansible/roles/gnocchi/templates/gnocchi.conf.j2 @@ -4,7 +4,7 @@ debug = {{ gnocchi_logging_debug }} log_dir = /var/log/kolla/gnocchi {% 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 %} {% if service_name == 'gnocchi-api' %} @@ -63,7 +63,7 @@ policy_file = {{ gnocchi_policy_file }} [incoming] {% if gnocchi_incoming_storage == '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 %} [storage] diff --git a/ansible/roles/mistral/templates/mistral.conf.j2 b/ansible/roles/mistral/templates/mistral.conf.j2 index 783c71ee92..1fb9314110 100644 --- a/ansible/roles/mistral/templates/mistral.conf.j2 +++ b/ansible/roles/mistral/templates/mistral.conf.j2 @@ -76,4 +76,4 @@ connection_string = {{ osprofiler_backend_connection_string }} {% endif %} [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 }}